summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/qtpatchoperation.cpp
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@nokia.com>2012-09-25 11:42:30 +0200
committerKarsten Heimrich <karsten.heimrich@digia.com>2012-09-26 14:42:25 +0200
commitf2064cbd7c8fbdf934130410027c271d21ba586c (patch)
tree9f556db4b62e047b816033a9f977da27b0a75ee3 /src/libs/installer/qtpatchoperation.cpp
parentbc77a40ae8d9df9166fb91e240323a3524ac6055 (diff)
Incorporate following changes to support Qt5.
d5e0dd38ead398d5be8126b4f21c0a50b7b61b17 72000567377d52d5d6e0db2b5d5b95407d85bbc1 Change-Id: I413f6f0ace095dc0d4b375cf392f8878e97ac27c Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Diffstat (limited to 'src/libs/installer/qtpatchoperation.cpp')
-rw-r--r--src/libs/installer/qtpatchoperation.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/libs/installer/qtpatchoperation.cpp b/src/libs/installer/qtpatchoperation.cpp
index c37bec8fe..cec0b84ed 100644
--- a/src/libs/installer/qtpatchoperation.cpp
+++ b/src/libs/installer/qtpatchoperation.cpp
@@ -139,10 +139,11 @@ bool QtPatchOperation::performOperation()
// Arguments:
// 1. type
// 2. new/target qtpath
+ // 3. version if greather Qt4
- if (arguments().count() != 2) {
+ if (arguments().count() != 3) {
setError(InvalidArguments);
- setErrorString(tr("Invalid arguments in %0: %1 arguments given, 2 expected.").arg(name())
+ setErrorString(tr("Invalid arguments in %0: %1 arguments given, 3 expected.").arg(name())
.arg(arguments().count()));
return false;
}
@@ -157,7 +158,7 @@ bool QtPatchOperation::performOperation()
"at this time."));
return false;
}
-
+
const QString newQtPathStr = QDir::toNativeSeparators(arguments().at(1));
const QByteArray newQtPath = newQtPathStr.toUtf8();
@@ -195,15 +196,20 @@ bool QtPatchOperation::performOperation()
return false;
}
- QFile patchFileListFile;
+ QString fileName;
if (type == QLatin1String("windows"))
- patchFileListFile.setFileName(QLatin1String(":/files-to-patch-windows"));
+ fileName = QString::fromLatin1(":/files-to-patch-windows");
else if (type == QLatin1String("linux"))
- patchFileListFile.setFileName(QLatin1String(":/files-to-patch-linux"));
+ fileName = QString::fromLatin1(":/files-to-patch-linux");
else if (type == QLatin1String("linux-emb-arm"))
- patchFileListFile.setFileName(QLatin1String(":/files-to-patch-linux-emb-arm"));
+ fileName = QString::fromLatin1(":/files-to-patch-linux-emb-arm");
else if (type == QLatin1String("mac"))
- patchFileListFile.setFileName(QLatin1String(":/files-to-patch-macx"));
+ fileName = QString::fromLatin1(":/files-to-patch-macx");
+
+ QFile patchFileListFile(fileName);
+ QString version = arguments().value(3).toLower();
+ if (!version.isEmpty())
+ patchFileListFile.setFileName(fileName + QLatin1Char('-') + version);
if (!patchFileListFile.open(QFile::ReadOnly)) {
setError(UserDefinedError);
@@ -337,7 +343,7 @@ bool QtPatchOperation::performOperation()
return false;
}
Q_CHECK_PTR(core);
- successMacRelocating = relocator.apply(newQtPathStr, core->value(scTargetDir));
+ successMacRelocating = relocator.apply(newQtPathStr, core->value(scTargetDir), version);
if (!successMacRelocating) {
setError(UserDefinedError);
setErrorString(tr("Error while relocating Qt: %1").arg(relocator.errorMessage()));