forked from qt-creator/qt-creator
CppEditor: Simplify CppCodeModelSettings setup
Change-Id: Ie6849caf8ded2c0901a9d2daeda6a1f81b68ed72 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -68,6 +68,11 @@ static FilePath fallbackClangdFilePath()
|
||||
return Environment::systemEnvironment().searchInPath("clangd");
|
||||
}
|
||||
|
||||
CppCodeModelSettings::CppCodeModelSettings()
|
||||
{
|
||||
fromSettings(Core::ICore::settings());
|
||||
}
|
||||
|
||||
void CppCodeModelSettings::fromSettings(QtcSettings *s)
|
||||
{
|
||||
s->beginGroup(Constants::CPPEDITOR_SETTINGSGROUP);
|
||||
@@ -594,4 +599,10 @@ int ClangdSettings::Data::defaultCompletionResults()
|
||||
return ok ? userValue : 100;
|
||||
}
|
||||
|
||||
CppCodeModelSettings &cppCodeModelSettings()
|
||||
{
|
||||
static CppCodeModelSettings theCppCodeModelSettings;
|
||||
return theCppCodeModelSettings;
|
||||
}
|
||||
|
||||
} // namespace CppEditor
|
||||
|
||||
Reference in New Issue
Block a user