diff options
author | Thiago Macieira <thiago@macieira.org> | 2013-12-11 17:56:27 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-12 03:33:34 +0100 |
commit | 1b5b562da8eb328f5e7b9ad86796e526f88bba09 (patch) | |
tree | 9576cf3d63283e14a10620d579ffe3ae7c2ad1b0 /qt-ui/subsurfacewebservices.cpp | |
parent | 5ac29bbe74052ca530fa4bbb102b708ff08c1142 (diff) | |
download | subsurface-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.cpp | 9 |
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(); } |