From ba138a185534269f6a6f32088965b12cbb898337 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 25 Jun 2021 16:50:52 +0200 Subject: CppTools: Add dedicated settings and settings page for clangd We plan to add more clangd settings, and it makes sense to have a dedicated place for them both in the code and the UI. Change-Id: Ideb92935b7a5a6a98e07980f4011736fb82042d1 Reviewed-by: David Schulz --- src/plugins/cpptools/cpptoolsplugin.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/plugins/cpptools/cpptoolsplugin.cpp') diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp index c5796e0dba..87ecc25d71 100644 --- a/src/plugins/cpptools/cpptoolsplugin.cpp +++ b/src/plugins/cpptools/cpptoolsplugin.cpp @@ -86,6 +86,7 @@ public: ~CppToolsPluginPrivate() { ExtensionSystem::PluginManager::removeObject(&m_cppProjectUpdaterFactory); + delete m_clangdSettingsPage; } StringTable stringTable; @@ -95,6 +96,7 @@ public: CppFileSettings m_fileSettings; CppFileSettingsPage m_cppFileSettingsPage{&m_fileSettings}; CppCodeModelSettingsPage m_cppCodeModelSettingsPage{&m_codeModelSettings}; + ClangdSettingsPage *m_clangdSettingsPage = nullptr; CppCodeStyleSettingsPage m_cppCodeStyleSettingsPage; CppProjectUpdaterFactory m_cppProjectUpdaterFactory; }; @@ -218,6 +220,8 @@ void CppToolsPlugin::extensionsInitialized() d->m_fileSettings.fromSettings(ICore::settings()); if (!d->m_fileSettings.applySuffixesToMimeDB()) qWarning("Unable to apply cpp suffixes to mime database (cpp mime types not found).\n"); + if (CppModelManager::instance()->isClangCodeModelActive()) + d->m_clangdSettingsPage = new ClangdSettingsPage; } CppCodeModelSettings *CppToolsPlugin::codeModelSettings() -- cgit v1.2.1