summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@nokia.com>2012-06-11 18:02:34 +0200
committerKarsten Heimrich <karsten.heimrich@nokia.com>2012-06-13 12:10:46 +0200
commitf924ee557ececb0a6fd5adc06dc9b4d552eaee12 (patch)
tree052451c4726fecdcc5817d9965ca7aeb9f9ecb23
parent99e489c191557e319d923e0a5ea7276e85742550 (diff)
Fix create archive with files only. See code comment.
Change-Id: Iba14d0a895cebd2a212221309dfbcd521db3e75e Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
-rw-r--r--src/libs/installer/lib7z_facade.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libs/installer/lib7z_facade.cpp b/src/libs/installer/lib7z_facade.cpp
index da25c6d28..7b995d0aa 100644
--- a/src/libs/installer/lib7z_facade.cpp
+++ b/src/libs/installer/lib7z_facade.cpp
@@ -1156,11 +1156,13 @@ void Lib7z::createArchive(QIODevice* archive, const QStringList &sourcePaths, Up
const QString tempFile = generateTempFileName();
NWildcard::CCensor censor;
- foreach (QString dir, sourcePaths) {
- const UString sourcePath = QString2UString(QDir::toNativeSeparators(dir));
- if (UString2QString(sourcePath) != QDir::toNativeSeparators(dir))
+ foreach (const QString &path, sourcePaths) {
+ const UString sourcePath = QString2UString(QDir::toNativeSeparators(path));
+ if (UString2QString(sourcePath) != QDir::toNativeSeparators(path))
throw UString2QString(sourcePath).toLatin1().data();
- censor.AddItem(true, sourcePath, true);
+ // Only pass recursive with true if path is a directory, otherwise we include the file and
+ // possible folders located on the same directory level as the file into the created archive.
+ censor.AddItem(true, sourcePath, QFileInfo(path).isDir());
}
CUpdateOptions options;