diff options
author | hjk <qthjk@ovi.com> | 2011-11-20 00:09:54 +0100 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@nokia.com> | 2011-11-21 13:16:15 +0100 |
commit | a188e46af2359ef43c24d66abbeea89dd70c7821 (patch) | |
tree | 1254d567c88aeb9fc08b6a82532cf201531480ed /installerbuilder/common | |
parent | 05c6a59c05d8b2b1168e5822da6b10bce79548fc (diff) |
Simplifications in PackageInfo and ZipJob.
Change-Id: If92e16fb5f27c262048471eb9ea45e5c247f65b9
Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
Diffstat (limited to 'installerbuilder/common')
-rw-r--r-- | installerbuilder/common/utils.cpp | 8 | ||||
-rw-r--r-- | installerbuilder/common/zipjob.cpp | 22 |
2 files changed, 8 insertions, 22 deletions
diff --git a/installerbuilder/common/utils.cpp b/installerbuilder/common/utils.cpp index 6267c82f6..ee3f89b9d 100644 --- a/installerbuilder/common/utils.cpp +++ b/installerbuilder/common/utils.cpp @@ -320,19 +320,19 @@ static QString qt_create_commandline(const QString &program, const QStringList & args = programName + QLatin1Char(' '); } - for (int i=0; i<arguments.size(); ++i) { + for (int i = 0; i < arguments.size(); ++i) { QString tmp = arguments.at(i); // in the case of \" already being in the string the \ must also be escaped - tmp.replace( QLatin1String("\\\""), QLatin1String("\\\\\"") ); + tmp.replace(QLatin1String("\\\""), QLatin1String("\\\\\"")); // escape a single " because the arguments will be parsed - tmp.replace( QLatin1Char('\"'), QLatin1String("\\\"") ); + tmp.replace(QLatin1Char('\"'), QLatin1String("\\\"")); if (tmp.isEmpty() || tmp.contains(QLatin1Char(' ')) || tmp.contains(QLatin1Char('\t'))) { // The argument must not end with a \ since this would be interpreted // as escaping the quote -- rather put the \ behind the quote: e.g. // rather use "foo"\ than "foo\" QString endQuote(QLatin1Char('\"')); int i = tmp.length(); - while (i>0 && tmp.at(i-1) == QLatin1Char('\\')) { + while (i > 0 && tmp.at(i - 1) == QLatin1Char('\\')) { --i; endQuote += QLatin1Char('\\'); } diff --git a/installerbuilder/common/zipjob.cpp b/installerbuilder/common/zipjob.cpp index 7fffd64ee..4593a8e95 100644 --- a/installerbuilder/common/zipjob.cpp +++ b/installerbuilder/common/zipjob.cpp @@ -42,14 +42,8 @@ class ZipJob::Private { - ZipJob *const q; public: - explicit Private(ZipJob *qq) : - q(qq), - outputDevice(0), - process(0) - { - } + Private() : outputDevice(0), process(0) {} QIODevice *outputDevice; QDir workingDir; @@ -60,7 +54,7 @@ public: Q_DECLARE_METATYPE(QProcess::ExitStatus) ZipJob::ZipJob() - : d(new Private(this)) + : d(new Private()) { qRegisterMetaType<QProcess::ExitStatus>(); } @@ -137,24 +131,16 @@ void ZipJob::setFilesToArchive(const QStringList &files) class UnzipJob::Private { - UnzipJob *const q; public: - explicit Private(UnzipJob *qq) - : q(qq), - inputDevice(0) - { - } + Private() : inputDevice(0) {} -public: QIODevice *inputDevice; QString outputPath; QStringList filesToExtract; }; UnzipJob::UnzipJob() - : QObject(), - QRunnable(), - d(new Private(this)) + : d(new Private()) { qRegisterMetaType<QProcess::ExitStatus>(); } |