diff options
author | Tim Jenssen <tim.jenssen@nokia.com> | 2012-05-24 17:10:58 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@nokia.com> | 2012-05-25 09:03:49 +0200 |
commit | b62f1ab053b5ed26b8e883481c6dae5561fad7b6 (patch) | |
tree | e576da3f6e266633cb9516c79a6027c13df4db0c /src/libs/installer/addqtcreatorarrayvalueoperation.cpp | |
parent | fb396036ccf3a0fd75d57c68e1e301b291245371 (diff) |
add a fallback for alreadys installed installations
Change-Id: Ib7dd955cb89e307d557b7a4706a885c031d6289f
Reviewed-by: Alexander Lenhardt <alexander.lenhardt@nokia.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@nokia.com>
Diffstat (limited to 'src/libs/installer/addqtcreatorarrayvalueoperation.cpp')
-rw-r--r-- | src/libs/installer/addqtcreatorarrayvalueoperation.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/libs/installer/addqtcreatorarrayvalueoperation.cpp b/src/libs/installer/addqtcreatorarrayvalueoperation.cpp index 8c1ead997..43520b7b3 100644 --- a/src/libs/installer/addqtcreatorarrayvalueoperation.cpp +++ b/src/libs/installer/addqtcreatorarrayvalueoperation.cpp @@ -71,14 +71,16 @@ bool AddQtCreatorArrayValueOperation::performOperation() setErrorString(tr("Needed installer object in %1 operation is empty.").arg(name())); return false; } - if (core->value(scQtCreatorInstallerSettingsFile).isEmpty()) { + + QString qtCreatorInstallerSettingsFileName = core->value(scQtCreatorInstallerSettingsFile); + if (qtCreatorInstallerSettingsFileName.isEmpty()) { setError(UserDefinedError); setErrorString(tr("There is no value set for %1 on the installer object.").arg( scQtCreatorInstallerSettingsFile)); return false; } - QSettings settings(core->value(scQtCreatorInstallerSettingsFile), QSettings::IniFormat); + QSettings settings(qtCreatorInstallerSettingsFileName, QSettings::IniFormat); const QString &group = groupName(args.at(0)); const QString &arrayName = args.at(1); @@ -127,7 +129,19 @@ bool AddQtCreatorArrayValueOperation::undoOperation() setErrorString(tr("Needed installer object in %1 operation is empty.").arg(name())); return false; } - QSettings settings(core->value(scQtCreatorInstallerSettingsFile), QSettings::IniFormat); + + // default value is the old value to keep the possibility that old saved operations can run undo +#ifdef Q_OS_MAC + QString qtCreatorInstallerSettingsFileName = core->value(scQtCreatorInstallerSettingsFile, + QString::fromLatin1("%1/Qt Creator.app/Contents/Resources/Nokia/QtCreator.ini").arg( + core->value(QLatin1String("TargetDir")))); +#else + QString qtCreatorInstallerSettingsFileName = core->value(scQtCreatorInstallerSettingsFile, + QString::fromLatin1("%1/QtCreator/share/qtcreator/Nokia/QtCreator.ini").arg(core->value( + QLatin1String("TargetDir")))); +#endif + + QSettings settings(qtCreatorInstallerSettingsFileName, QSettings::IniFormat); const QString &group = groupName(args.at(0)); const QString &arrayName = args.at(1); |