mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 07:33:24 +00:00
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:
parent
5ac29bbe74
commit
1b5b562da8
1 changed files with 9 additions and 0 deletions
|
@ -760,6 +760,15 @@ void DivelogsDeWebServices::downloadFinished()
|
||||||
// now allow the user to cancel or accept
|
// now allow the user to cancel or accept
|
||||||
ui.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(true);
|
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);
|
zip_close(zip);
|
||||||
zipFile.close();
|
zipFile.close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue