summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-26 06:27:40 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-26 06:51:47 -0700
commitaa78c5b0ec7f19ab43801ef9d7a2c6eda9255662 (patch)
tree3af10ed11be8abc2eebc5107bb07b0250ef0f247 /qt-ui
parent3b0f38f24a3c3d7ccadf8c0b0011dfc58c2f9d46 (diff)
downloadsubsurface-aa78c5b0ec7f19ab43801ef9d7a2c6eda9255662.tar.gz
Allow building with both libzip 0.11.x and 1.0.x
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/subsurfacewebservices.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp
index 18f42819e..ee079cc48 100644
--- a/qt-ui/subsurfacewebservices.cpp
+++ b/qt-ui/subsurfacewebservices.cpp
@@ -262,9 +262,13 @@ bool DivelogsDeWebServices::prepare_dives_for_divelogs(const QString &tempfile,
xsltFreeStylesheet(xslt);
if (zip_close(zip)) {
int ze, se;
+#if LIBZIP_VERSION_MAJOR >= 1
zip_error_t *error = zip_get_error(zip);
ze = zip_error_code_zip(error);
se = zip_error_code_system(error);
+#else
+ zip_error_get(zip, &ze, &se);
+#endif
report_error(qPrintable(tr("error writing zip file: %s zip error %d system error %d - %s")),
qPrintable(QDir::toNativeSeparators(tempfile)), ze, se, zip_strerror(zip));
return false;