forked from qt-creator/qt-creator
TextEditor: fix loading outline cursor synchronization setting
The button was set to the correct enabled state, but not the member that holds the information whether the outline should be synchronized with the cursor. Change-Id: I57f96e02dc0a9a954874fefa4926741b389c3783 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -177,7 +177,6 @@ void OutlineWidgetStack::restoreSettings(Utils::QtcSettings *settings, int posit
|
|||||||
const Key baseKey = numberedKey("Outline.", position) + '.';
|
const Key baseKey = numberedKey("Outline.", position) + '.';
|
||||||
const QString baseKeyString = stringFromKey(baseKey);
|
const QString baseKeyString = stringFromKey(baseKey);
|
||||||
|
|
||||||
bool syncWithEditor = true;
|
|
||||||
m_widgetSettings.clear();
|
m_widgetSettings.clear();
|
||||||
const QStringList longKeys = settings->allKeys();
|
const QStringList longKeys = settings->allKeys();
|
||||||
for (const QString &longKey : longKeys) {
|
for (const QString &longKey : longKeys) {
|
||||||
@@ -187,13 +186,13 @@ void OutlineWidgetStack::restoreSettings(Utils::QtcSettings *settings, int posit
|
|||||||
const QString key = longKey.mid(baseKeyString.length());
|
const QString key = longKey.mid(baseKeyString.length());
|
||||||
|
|
||||||
if (key == QLatin1String("SyncWithEditor")) {
|
if (key == QLatin1String("SyncWithEditor")) {
|
||||||
syncWithEditor = settings->value(keyFromString(longKey)).toBool();
|
m_syncWithEditor = settings->value(keyFromString(longKey)).toBool();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
m_widgetSettings.insert(key, settings->value(keyFromString(longKey)));
|
m_widgetSettings.insert(key, settings->value(keyFromString(longKey)));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_toggleSync->setChecked(syncWithEditor);
|
m_toggleSync->setChecked(m_syncWithEditor);
|
||||||
if (auto outlineWidget = qobject_cast<IOutlineWidget*>(currentWidget()))
|
if (auto outlineWidget = qobject_cast<IOutlineWidget*>(currentWidget()))
|
||||||
outlineWidget->restoreSettings(m_widgetSettings);
|
outlineWidget->restoreSettings(m_widgetSettings);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user