CppTools: Make CppCodeStyleSettingsPage a plugin pimpl member

Change-Id: I75f90ddbb3cb1f2dbded16c8b6eb6d6c9bbc9f50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2020-02-04 17:38:55 +01:00
parent 278e981422
commit ede1d31a3f
3 changed files with 3 additions and 9 deletions

View File

@@ -345,8 +345,7 @@ void CppCodeStylePreferencesWidget::setVisualizeWhitespace(bool on)
// ------------------ CppCodeStyleSettingsPage
CppCodeStyleSettingsPage::CppCodeStyleSettingsPage(QWidget *parent)
: Core::IOptionsPage(parent)
CppCodeStyleSettingsPage::CppCodeStyleSettingsPage()
{
setId(Constants::CPP_CODE_STYLE_SETTINGS_ID);
setDisplayName(QCoreApplication::translate("CppTools", Constants::CPP_CODE_STYLE_SETTINGS_NAME));

View File

@@ -80,10 +80,8 @@ private:
class CppCodeStyleSettingsPage : public Core::IOptionsPage
{
Q_OBJECT
public:
explicit CppCodeStyleSettingsPage(QWidget *parent = nullptr);
CppCodeStyleSettingsPage();
QWidget *widget() override;
void apply() override;

View File

@@ -83,13 +83,10 @@ public:
CppToolsPluginPrivate()
{
m_codeModelSettings.fromSettings(ICore::settings());
m_cppCodeStyleSettingsPage = new CppCodeStyleSettingsPage;
}
~CppToolsPluginPrivate()
{
if (m_cppCodeStyleSettingsPage)
delete m_cppCodeStyleSettingsPage;
ExtensionSystem::PluginManager::removeObject(&m_cppProjectUpdaterFactory);
}
@@ -100,7 +97,7 @@ public:
CppFileSettings m_fileSettings;
CppFileSettingsPage m_cppFileSettingsPage{&m_fileSettings};
CppCodeModelSettingsPage m_cppCodeModelSettingsPage{&m_codeModelSettings};
QPointer<CppCodeStyleSettingsPage> m_cppCodeStyleSettingsPage = nullptr;
CppCodeStyleSettingsPage m_cppCodeStyleSettingsPage;
CppProjectUpdaterFactory m_cppProjectUpdaterFactory;
};