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:
David Schulz
2025-01-09 10:50:11 +01:00
parent 9ae3ed33c5
commit 4fbdb3ad39

View File

@@ -177,7 +177,6 @@ void OutlineWidgetStack::restoreSettings(Utils::QtcSettings *settings, int posit
const Key baseKey = numberedKey("Outline.", position) + '.';
const QString baseKeyString = stringFromKey(baseKey);
bool syncWithEditor = true;
m_widgetSettings.clear();
const QStringList longKeys = settings->allKeys();
for (const QString &longKey : longKeys) {
@@ -187,13 +186,13 @@ void OutlineWidgetStack::restoreSettings(Utils::QtcSettings *settings, int posit
const QString key = longKey.mid(baseKeyString.length());
if (key == QLatin1String("SyncWithEditor")) {
syncWithEditor = settings->value(keyFromString(longKey)).toBool();
m_syncWithEditor = settings->value(keyFromString(longKey)).toBool();
continue;
}
m_widgetSettings.insert(key, settings->value(keyFromString(longKey)));
}
m_toggleSync->setChecked(syncWithEditor);
m_toggleSync->setChecked(m_syncWithEditor);
if (auto outlineWidget = qobject_cast<IOutlineWidget*>(currentWidget()))
outlineWidget->restoreSettings(m_widgetSettings);
}