From 6d7387f1aaeb7f461c96855a462301ce2c661585 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 23 Jan 2024 17:05:49 +0100 Subject: [PATCH] CppEditor: Fix restoring per-project cpp file name settings Another victim of Utils::Store. Also add missing initialization of "is global" state. Change-Id: I3d20e1403795366044d3b2df552f2a5947ba8c98 Reviewed-by: Qt CI Bot Reviewed-by: Reviewed-by: hjk --- src/plugins/cppeditor/cppfilesettingspage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/cppfilesettingspage.cpp b/src/plugins/cppeditor/cppfilesettingspage.cpp index f9e83e4719b..9e2e119c97e 100644 --- a/src/plugins/cppeditor/cppfilesettingspage.cpp +++ b/src/plugins/cppeditor/cppfilesettingspage.cpp @@ -489,7 +489,7 @@ void CppFileSettingsForProject::loadSettings() if (!entry.isValid()) return; - const QVariantMap data = entry.toMap(); + const QVariantMap data = mapEntryFromStoreEntry(entry).toMap(); m_useGlobalSettings = data.value(useGlobalKeyC, true).toBool(); m_customSettings.headerPrefixes = data.value(headerPrefixesKeyC, m_customSettings.headerPrefixes).toStringList(); @@ -553,6 +553,8 @@ CppFileSettingsForProjectWidget::CppFileSettingsForProjectWidget( const CppFileSettingsForProject &settings) : d(new Private(settings)) { setGlobalSettingsId(Constants::CPP_FILE_SETTINGS_ID); + setUseGlobalSettings(settings.useGlobalSettings()); + const auto layout = new QVBoxLayout(this); layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(&d->widget);