CMake: Move settings storage closer to class implementation

Simpler in use.

Change-Id: I8cc929001035974b9b73566b206410bfd77f73a6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2023-01-20 09:10:23 +01:00
parent 38faf098c8
commit 87c3f08e52
10 changed files with 24 additions and 34 deletions

View File

@@ -74,7 +74,7 @@ public:
};
CMakeSettingsPage settingsPage;
CMakeSpecificSettingsPage specificSettings{CMakeProjectPlugin::projectTypeSpecificSettings()};
CMakeSpecificSettingsPage specificSettings;
CMakeManager manager;
CMakeBuildStepFactory buildStepFactory;
@@ -138,12 +138,6 @@ void CMakeProjectPluginPrivate::autoFormatOnSave(Core::IDocument *document)
TextEditor::formatEditor(widget, command);
}
CMakeSpecificSettings *CMakeProjectPlugin::projectTypeSpecificSettings()
{
static CMakeSpecificSettings theSettings;
return &theSettings;
}
CMakeProjectPlugin::~CMakeProjectPlugin()
{
delete d;
@@ -152,7 +146,7 @@ CMakeProjectPlugin::~CMakeProjectPlugin()
void CMakeProjectPlugin::initialize()
{
d = new CMakeProjectPluginPrivate;
projectTypeSpecificSettings()->readSettings(ICore::settings());
CMakeSpecificSettings::instance()->readSettings(ICore::settings());
const Context projectContext{CMakeProjectManager::Constants::CMAKE_PROJECT_ID};