summaryrefslogtreecommitdiffstats
path: root/qt-ui/subsurfacewebservices.cpp
diff options
context:
space:
mode:
authorGravatar Thiago Macieira <thiago@macieira.org>2013-12-11 17:56:27 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-12 03:33:34 +0100
commit1b5b562da8eb328f5e7b9ad86796e526f88bba09 (patch)
tree9576cf3d63283e14a10620d579ffe3ae7c2ad1b0 /qt-ui/subsurfacewebservices.cpp
parent5ac29bbe74052ca530fa4bbb102b708ff08c1142 (diff)
downloadsubsurface-1b5b562da8eb328f5e7b9ad86796e526f88bba09.tar.gz
Fix compilation with older libzip
Older libzip lack zip_get_num_entries. Thanks to Lubomir for spotting the version macro. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/subsurfacewebservices.cpp')
-rw-r--r--qt-ui/subsurfacewebservices.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp
index b974191c7..c0091fc03 100644
--- a/qt-ui/subsurfacewebservices.cpp
+++ b/qt-ui/subsurfacewebservices.cpp
@@ -760,6 +760,15 @@ void DivelogsDeWebServices::downloadFinished()
// now allow the user to cancel or accept
ui.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(true);
+ quint64 entries;
+#if defined(LIBZIP_VERSION_MAJOR)
+ entries = zip_get_num_entries(zip, 0);
+#else
+ // old version of libzip
+ entries = zip_get_num_files(zip);
+#endif
+
+
zip_close(zip);
zipFile.close();
}