Try to fix divelogs upload on Windows

zip_open needs correct directory separators. QFile::encodeName does not
do this conversion, so we must call it explicitly.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2014-08-03 20:22:48 +03:00 committed by Dirk Hohndel
parent 2ad433671f
commit 2b100c8c17

View file

@ -124,7 +124,7 @@ bool DivelogsDeWebServices::prepare_dives_for_divelogs(const QString &tempfile,
int error_code; int error_code;
zip = zip_open(QFile::encodeName(tempfile), ZIP_CREATE, &error_code); zip = zip_open(QFile::encodeName(QDir::toNativeSeparators(tempfile)), ZIP_CREATE, &error_code);
if (!zip) { if (!zip) {
char buffer[1024]; char buffer[1024];
zip_error_to_str(buffer, sizeof buffer, error_code, errno); zip_error_to_str(buffer, sizeof buffer, error_code, errno);