forked from qt-creator/qt-creator
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>
This commit is contained in:
committed by
Orgad Shaneh
parent
62554e7647
commit
338e9a092b
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user