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>
This commit is contained in:
Thiago Macieira 2013-12-11 17:56:27 -08:00 committed by Dirk Hohndel
parent 5ac29bbe74
commit 1b5b562da8

View file

@ -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();
}