CppTools: Use a plugin pimpl data member for CppToolsSettings

Change-Id: I05c2f8f34b88973fc916115f71c0557675396366
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2020-02-04 17:30:29 +01:00
parent cd9571b4f7
commit 7e326657e9
3 changed files with 4 additions and 6 deletions

View File

@@ -82,7 +82,6 @@ class CppToolsPluginPrivate
public:
CppToolsPluginPrivate()
{
m_settings = new CppToolsSettings(m_instance); // force registration of cpp tools settings
m_codeModelSettings.fromSettings(ICore::settings());
m_cppCodeStyleSettingsPage = new CppCodeStyleSettingsPage;
}
@@ -97,7 +96,7 @@ public:
StringTable stringTable;
CppModelManager modelManager;
CppCodeModelSettings m_codeModelSettings;
CppToolsSettings *m_settings = nullptr;
CppToolsSettings settings;
CppFileSettings m_fileSettings;
CppFileSettingsPage m_cppFileSettingsPage{&m_fileSettings};
CppCodeModelSettingsPage m_cppCodeModelSettingsPage{&m_codeModelSettings};

View File

@@ -64,9 +64,8 @@ public:
CppToolsSettings *CppToolsSettings::m_instance = nullptr;
CppToolsSettings::CppToolsSettings(QObject *parent)
: QObject(parent)
, d(new Internal::CppToolsSettingsPrivate)
CppToolsSettings::CppToolsSettings()
: d(new Internal::CppToolsSettingsPrivate)
{
QTC_ASSERT(!m_instance, return);
m_instance = this;

View File

@@ -50,7 +50,7 @@ class CPPTOOLS_EXPORT CppToolsSettings : public QObject
Q_OBJECT
public:
explicit CppToolsSettings(QObject *parent);
CppToolsSettings();
~CppToolsSettings() override;
static CppToolsSettings *instance();