summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libs/installer/lib7z_facade.cpp11
-rw-r--r--src/libs/installer/lib7z_facade.h37
2 files changed, 30 insertions, 18 deletions
diff --git a/src/libs/installer/lib7z_facade.cpp b/src/libs/installer/lib7z_facade.cpp
index c89ce35e1..624c08b54 100644
--- a/src/libs/installer/lib7z_facade.cpp
+++ b/src/libs/installer/lib7z_facade.cpp
@@ -1402,7 +1402,8 @@ void Lib7z::createArchive(QIODevice* archive, const QStringList &sourcePaths, Up
}
}
-void Lib7z::extractArchive(QIODevice* archive, const File& item, QIODevice* target, ExtractCallback* callback)
+void Lib7z::extractFileFromArchive(QIODevice* archive, const File& item, QIODevice* target,
+ ExtractCallback* callback)
{
assert(archive);
assert(target);
@@ -1452,7 +1453,7 @@ void Lib7z::extractArchive(QIODevice* archive, const File& item, QIODevice* targ
}
}
-void Lib7z::extractArchive(QIODevice* archive, const File& item, const QString &targetDirectory,
+void Lib7z::extractFileFromArchive(QIODevice* archive, const File& item, const QString &targetDirectory,
ExtractCallback* callback)
{
assert(archive);
@@ -1472,7 +1473,7 @@ void Lib7z::extractArchive(QIODevice* archive, const File& item, const QString &
if (item.permissions)
out.setPermissions(item.permissions);
callback->setTarget(&out);
- extractArchive(archive, item, &out, callback);
+ extractFileFromArchive(archive, item, &out, callback);
outDir.release();
}
@@ -1559,9 +1560,9 @@ void ExtractItemJob::doStart()
if (!d->archive)
throw SevenZipException(tr("Could not list archive: QIODevice not set or already destroyed."));
if (d->target)
- extractArchive(d->archive, d->item, d->target, d->callback);
+ extractFileFromArchive(d->archive, d->item, d->target, d->callback);
else if (!d->item.path.isEmpty())
- extractArchive(d->archive, d->item, d->targetDirectory, d->callback);
+ extractFileFromArchive(d->archive, d->item, d->targetDirectory, d->callback);
else
extractArchive(d->archive, d->targetDirectory, d->callback);
} catch (const SevenZipException& e) {
diff --git a/src/libs/installer/lib7z_facade.h b/src/libs/installer/lib7z_facade.h
index f84cd987f..a783fbd44 100644
--- a/src/libs/installer/lib7z_facade.h
+++ b/src/libs/installer/lib7z_facade.h
@@ -85,7 +85,6 @@ namespace Lib7z {
QFile::Permissions permissions;
QString path;
- QString name;
QDateTime mtime;
quint64 uncompressedSize;
quint64 compressedSize;
@@ -151,20 +150,32 @@ namespace Lib7z {
void deviceDestroyed(QObject*);
};
- /*
- * @throws Lib7z::SevenZipException
- */
- void INSTALLER_EXPORT extractArchive( QIODevice* archive, const File& item, QIODevice* out, ExtractCallback* callback=0 );
+ /*!
+ Extracts the given File \a file from \a archive into output device \a out using the provided extract
+ callback \a callback.
- /*
- * @throws Lib7z::SevenZipException
- */
- void INSTALLER_EXPORT extractArchive( QIODevice* archive, const File& item, const QString& targetDirectory, ExtractCallback* callback=0 );
+ Throws Lib7z::SevenZipException on error.
+ */
+ void INSTALLER_EXPORT extractFileFromArchive(QIODevice* archive, const File& item, QIODevice* out,
+ ExtractCallback* callback=0 );
- /*
- * @throws Lib7z::SevenZipException
- */
- void INSTALLER_EXPORT extractArchive( QIODevice* archive, const QString& targetDirectory, ExtractCallback* callback=0 );
+ /*!
+ Extracts the given File \a file from \a archive into target directory \a targetDirectory using the
+ provided extract callback \a callback. The output filename is deduced from the \a file path name.
+
+ Throws Lib7z::SevenZipException on error.
+ */
+ void INSTALLER_EXPORT extractFileFromArchive(QIODevice* archive, const File& item,
+ const QString& targetDirectory, ExtractCallback* callback = 0);
+
+ /*!
+ Extracts the given \a archive content into target directory \a targetDirectory using the
+ provided extract callback \a callback. The output filenames are deduced from the \a archive content.
+
+ Throws Lib7z::SevenZipException on error.
+ */
+ void INSTALLER_EXPORT extractArchive(QIODevice* archive, const QString& targetDirectory,
+ ExtractCallback* callback = 0);
/*
* @thows Lib7z::SevenZipException