forked from qt-creator/qt-creator
CppEditor: Hide ClangdSettingsPage setup in .cpp
Change-Id: I3606e503ea512750b06a94901e5391ce6dae86e3 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -575,12 +575,21 @@ private:
|
||||
ClangdSettingsWidget m_widget;
|
||||
};
|
||||
|
||||
ClangdSettingsPage::ClangdSettingsPage()
|
||||
class ClangdSettingsPage final : public Core::IOptionsPage
|
||||
{
|
||||
setId(Constants::CPP_CLANGD_SETTINGS_ID);
|
||||
setDisplayName(Tr::tr("Clangd"));
|
||||
setCategory(Constants::CPP_SETTINGS_CATEGORY);
|
||||
setWidgetCreator([] { return new ClangdSettingsPageWidget; });
|
||||
public:
|
||||
ClangdSettingsPage()
|
||||
{
|
||||
setId(Constants::CPP_CLANGD_SETTINGS_ID);
|
||||
setDisplayName(Tr::tr("Clangd"));
|
||||
setCategory(Constants::CPP_SETTINGS_CATEGORY);
|
||||
setWidgetCreator([] { return new ClangdSettingsPageWidget; });
|
||||
}
|
||||
};
|
||||
|
||||
void setupClangdSettingsPage()
|
||||
{
|
||||
static ClangdSettingsPage theClangdSettingsPage;
|
||||
}
|
||||
|
||||
class ClangdProjectSettingsWidget : public ProjectSettingsWidget
|
||||
|
@@ -15,12 +15,6 @@ public:
|
||||
explicit CppCodeModelSettingsPage(CppCodeModelSettings *settings);
|
||||
};
|
||||
|
||||
class ClangdSettingsPage final : public Core::IOptionsPage
|
||||
{
|
||||
public:
|
||||
explicit ClangdSettingsPage();
|
||||
};
|
||||
|
||||
class ClangdSettingsWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -40,5 +34,6 @@ private:
|
||||
};
|
||||
|
||||
void setupClangdProjectSettingsPanel();
|
||||
void setupClangdSettingsPage();
|
||||
|
||||
} // CppEditor::Internal
|
||||
|
@@ -160,11 +160,6 @@ public:
|
||||
class CppEditorPluginPrivate : public QObject
|
||||
{
|
||||
public:
|
||||
~CppEditorPluginPrivate()
|
||||
{
|
||||
delete m_clangdSettingsPage;
|
||||
}
|
||||
|
||||
void onTaskStarted(Utils::Id type);
|
||||
void onAllTasksFinished(Utils::Id type);
|
||||
void inspectCppCodeModel();
|
||||
@@ -189,7 +184,6 @@ public:
|
||||
CppFileSettings m_fileSettings;
|
||||
CppFileSettingsPage m_cppFileSettingsPage{&m_fileSettings};
|
||||
CppCodeModelSettingsPage m_cppCodeModelSettingsPage{&m_codeModelSettings};
|
||||
ClangdSettingsPage *m_clangdSettingsPage = nullptr;
|
||||
CppCodeStyleSettingsPage m_cppCodeStyleSettingsPage;
|
||||
CppProjectUpdaterFactory m_cppProjectUpdaterFactory;
|
||||
};
|
||||
@@ -238,7 +232,13 @@ void CppEditorPlugin::initialize()
|
||||
|
||||
void CppEditorPlugin::extensionsInitialized()
|
||||
{
|
||||
setupProjectPanels();
|
||||
setupCppQuickFixProjectPanel();
|
||||
setupCppFileSettingsProjectPanel();
|
||||
|
||||
if (CppModelManager::isClangCodeModelActive()) {
|
||||
setupClangdProjectSettingsPanel();
|
||||
setupClangdSettingsPage();
|
||||
}
|
||||
|
||||
d->m_fileSettings.fromSettings(ICore::settings());
|
||||
d->m_fileSettings.addMimeInitializer();
|
||||
@@ -478,17 +478,6 @@ void CppEditorPlugin::addGlobalActions()
|
||||
&CppModelManager::updateModifiedSourceFiles);
|
||||
}
|
||||
|
||||
void CppEditorPlugin::setupProjectPanels()
|
||||
{
|
||||
setupCppQuickFixProjectPanel();
|
||||
setupCppFileSettingsProjectPanel();
|
||||
|
||||
if (CppModelManager::isClangCodeModelActive()) {
|
||||
d->m_clangdSettingsPage = new ClangdSettingsPage;
|
||||
setupClangdProjectSettingsPanel();
|
||||
}
|
||||
}
|
||||
|
||||
void CppEditorPlugin::registerVariables()
|
||||
{
|
||||
MacroExpander * const expander = globalMacroExpander();
|
||||
|
@@ -58,7 +58,6 @@ private:
|
||||
void addActionsForSelections();
|
||||
void addPerFileActions();
|
||||
void addGlobalActions();
|
||||
void setupProjectPanels();
|
||||
void registerVariables();
|
||||
void registerTests();
|
||||
|
||||
|
Reference in New Issue
Block a user