From 50b8412a2690e8b2cbbbbc5c8481e45df084603d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Thu, 25 May 2017 01:24:27 +0200 Subject: NOISSUE do not try to restore file permissions when importing modpacks --- api/logic/MMCZip.h | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'api/logic/MMCZip.h') diff --git a/api/logic/MMCZip.h b/api/logic/MMCZip.h index f350e668..7608352c 100644 --- a/api/logic/MMCZip.h +++ b/api/logic/MMCZip.h @@ -49,16 +49,6 @@ namespace MMCZip */ bool MULTIMC_LOGIC_EXPORT createModdedJar(QString sourceJarPath, QString targetJarPath, const QList& mods); - /** - * Extract a whole archive. - * - * \param fileCompressed The name of the archive. - * \param dir The directory to extract to, the current directory if - * left empty. - * \return The list of the full paths of the files extracted, empty on failure. - */ - QStringList MULTIMC_LOGIC_EXPORT extractDir(QString fileCompressed, QString dir = QString()); - /** * Find a single file in archive by file name (not path) * @@ -74,15 +64,31 @@ namespace MMCZip */ bool MULTIMC_LOGIC_EXPORT findFilesInZip(QuaZip * zip, const QString & what, QStringList & result, const QString &root = QString()); + enum Option { + NoPermissions = 1 + }; + Q_DECLARE_FLAGS(Options, Option) + /** * Extract a single file to a destination * * \return true if it succeeds */ - bool MULTIMC_LOGIC_EXPORT extractFile(QuaZip *zip, const QString &fileName, const QString &fileDest); + bool MULTIMC_LOGIC_EXPORT extractFile(QuaZip *zip, const QString &fileName, const QString &fileDest, Options opts = 0); /** * Extract a subdirectory from an archive */ - QStringList MULTIMC_LOGIC_EXPORT extractSubDir(QuaZip *zip, const QString & subdir, const QString &target); + QStringList MULTIMC_LOGIC_EXPORT extractSubDir(QuaZip *zip, const QString & subdir, const QString &target, Options opts = 0); + + /** + * Extract a whole archive. + * + * \param fileCompressed The name of the archive. + * \param dir The directory to extract to, the current directory if left empty. + * \param opts Extra options. + * \return The list of the full paths of the files extracted, empty on failure. + */ + QStringList MULTIMC_LOGIC_EXPORT extractDir(QString fileCompressed, QString dir, Options opts = 0); + } -- cgit v1.2.3