diff options
author | kh1 <karsten.heimrich@digia.com> | 2013-04-30 15:49:12 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@digia.com> | 2013-05-06 12:51:24 +0200 |
commit | 23b7654f0d80cc56990cef19f6d4b06b209120b5 (patch) | |
tree | f80c6d4924af29b7e594fddd5562ca34da2e82ec | |
parent | 685b2f25462820d5394a6a61778018b83c3b18d3 (diff) |
Rename and document functions to be more clear what they do.
Change-Id: Ic31df64c4eff8aa19b58d4dcd26b7f99c9e90d3c
Reviewed-by: Niels Weber <niels.weber@digia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
-rw-r--r-- | src/libs/installer/lib7z_facade.cpp | 11 | ||||
-rw-r--r-- | src/libs/installer/lib7z_facade.h | 37 |
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 |