diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2013-07-01 08:34:39 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2013-07-01 11:19:35 +0200 |
commit | 338e9a092ba189dc8a75eca49724e1800749a855 (patch) | |
tree | 5bf53babc1db60d3353d779248fa5f41b321dc79 /src | |
parent | 62554e7647d16e8c916ebd89235f1bafe6cb253e (diff) | |
download | qt-creator-338e9a092ba189dc8a75eca49724e1800749a855.tar.gz |
SettingsAccessor: Fix empty environmentId handling
* Empty environment should be ignored when comparing to current one
* Fixes superfluous warning when opening a .user file without environmentId
Change-Id: Iaf3f71eb2dd2a2a10faa1f6f9fe9e9154fe1ab1f
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/projectexplorer/settingsaccessor.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/projectexplorer/settingsaccessor.cpp b/src/plugins/projectexplorer/settingsaccessor.cpp index a4b774aaa7..923b1ba370 100644 --- a/src/plugins/projectexplorer/settingsaccessor.cpp +++ b/src/plugins/projectexplorer/settingsaccessor.cpp @@ -734,7 +734,7 @@ void SettingsAccessor::backupUserFile() const // Do we need to do a backup? const QString origName = oldSettings.fileName().toString(); QString backupName = origName; - if (oldSettings.environmentId() != creatorId()) + if (!oldSettings.environmentId().isEmpty() && oldSettings.environmentId() != creatorId()) backupName += QLatin1String(".") + QString::fromLatin1(oldSettings.environmentId()).mid(1, 7); if (oldSettings.version() != currentVersion()) { if (m_handlers.contains(oldSettings.version())) @@ -774,7 +774,7 @@ SettingsAccessor::SettingsData SettingsAccessor::readUserSettings() const "<p>All settings files were either too new or too " "old to be read.</p>"), QMessageBox::Ok); - } else if (result.environmentId() != creatorId()) { + } else if (!result.environmentId().isEmpty() && result.environmentId() != creatorId()) { // Wrong environment! QMessageBox msgBox( QMessageBox::Question, @@ -873,7 +873,7 @@ SettingsAccessor::SettingsData SettingsAccessor::findBestSettings(const QStringL continue; } - if (!tmp.environmentId().isEmpty() && tmp.environmentId() == creatorId()) { + if (tmp.environmentId().isEmpty() || tmp.environmentId() == creatorId()) { if (tmp.version() > newestMatching.version()) newestMatching = tmp; } else { |