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/setqtcreatorvalueoperation.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/setqtcreatorvalueoperation.cpp')
-rw-r--r-- | src/libs/installer/setqtcreatorvalueoperation.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/libs/installer/setqtcreatorvalueoperation.cpp b/src/libs/installer/setqtcreatorvalueoperation.cpp index dc5e6fd0a..d1fb074d1 100644 --- a/src/libs/installer/setqtcreatorvalueoperation.cpp +++ b/src/libs/installer/setqtcreatorvalueoperation.cpp @@ -83,13 +83,14 @@ bool SetQtCreatorValueOperation::performOperation() const QString &key = args.at(2); const QString &settingsValue = args.at(3); { - 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); if (!group.isEmpty()) settings.beginGroup(group); @@ -143,13 +144,18 @@ bool SetQtCreatorValueOperation::undoOperation() return false; } - if (core->value(scQtCreatorInstallerSettingsFile).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); + // 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); if (!group.isEmpty()) settings.beginGroup(group); |