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