Skip to content
Permalink
Browse files

Fix compilation by taking libzip version into account

  • Loading branch information
pblottiere committed Jul 17, 2017
1 parent ba74e64 commit 2d660a1e253d8be2ecbb6bc73c370ce3bbb52893
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/core/qgsziputils.cpp
@@ -141,7 +141,12 @@ bool QgsZipUtils::zip( const QString &zipFilename, const QStringList &files )
zip_source *src = zip_source_file( z, file.toStdString().c_str(), 0, 0 );
if ( src != NULL )
{
if ( zip_file_add( z, fileInfo.fileName().toStdString().c_str(), src, 0 ) == -1 )
#if LIBZIP_VERSION_MAJOR < 1
int rc = ( int ) zip_add( z, fileInfo.fileName().toStdString().c_str(), src );
#else
int rc = ( int ) zip_file_add( z, fileInfo.fileName().toStdString().c_str(), src, 0 );
#endif
if ( rc == -1 )
{
QString err = QObject::tr( "Error adding file: '%1'" ).arg( zip_strerror( z ) );
QgsMessageLog::logMessage( err, QStringLiteral( "QgsZipUtils" ) );

0 comments on commit 2d660a1

Please sign in to comment.
You can’t perform that action at this time.