forked from qt-creator/qt-creator
DiffEditor: drop legacy settings
Change-Id: I94147168c33d7b44a1288b51fe3d9a3ae46c8cdd Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -64,7 +64,6 @@ static const char ignoreWhitespaceKeyC[] = "IgnoreWhitespace";
|
|||||||
|
|
||||||
static const char diffViewKeyC[] = "DiffEditorType";
|
static const char diffViewKeyC[] = "DiffEditorType";
|
||||||
|
|
||||||
static const char legacySettingsGroupC[] = "Git";
|
|
||||||
static const char useDiffEditorKeyC[] = "UseDiffEditor";
|
static const char useDiffEditorKeyC[] = "UseDiffEditor";
|
||||||
|
|
||||||
using namespace TextEditor;
|
using namespace TextEditor;
|
||||||
@@ -574,20 +573,6 @@ IDiffView *DiffEditor::loadSettings()
|
|||||||
QTC_ASSERT(currentView(), return 0);
|
QTC_ASSERT(currentView(), return 0);
|
||||||
QSettings *s = Core::ICore::settings();
|
QSettings *s = Core::ICore::settings();
|
||||||
|
|
||||||
// TODO: Remove in 3.6: Read legacy settings first:
|
|
||||||
s->beginGroup(QLatin1String(legacySettingsGroupC));
|
|
||||||
const bool legacyExists = s->contains(QLatin1String(useDiffEditorKeyC));
|
|
||||||
const bool legacyEditor = s->value(
|
|
||||||
QLatin1String(useDiffEditorKeyC), true).toBool();
|
|
||||||
s->remove(QLatin1String(useDiffEditorKeyC));
|
|
||||||
s->endGroup();
|
|
||||||
|
|
||||||
// Save legacy settings to current settings:
|
|
||||||
if (legacyExists) {
|
|
||||||
saveSetting(QLatin1String(diffViewKeyC), legacyEditor ? m_views.at(0)->id().toSetting() :
|
|
||||||
m_views.at(1)->id().toSetting());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Read current settings:
|
// Read current settings:
|
||||||
s->beginGroup(QLatin1String(settingsGroupC));
|
s->beginGroup(QLatin1String(settingsGroupC));
|
||||||
m_showDescription = s->value(QLatin1String(descriptionVisibleKeyC), true).toBool();
|
m_showDescription = s->value(QLatin1String(descriptionVisibleKeyC), true).toBool();
|
||||||
|
|||||||
Reference in New Issue
Block a user