forked from qt-creator/qt-creator
CppEditor: Make a few CppModelManager functions static
... to simplify code using it. Change-Id: Ib2bfbb5a17a1d48088a9cf4973d4c3f006cd34e4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -53,7 +53,7 @@ void ClangCodeModelPlugin::generateCompilationDB()
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
const auto projectInfo = CppModelManager::instance()->projectInfo(target->project());
|
||||
const auto projectInfo = CppModelManager::projectInfo(target->project());
|
||||
if (!projectInfo)
|
||||
return;
|
||||
FilePath baseDir = projectInfo->buildRoot();
|
||||
@@ -78,7 +78,7 @@ ClangCodeModelPlugin::~ClangCodeModelPlugin()
|
||||
void ClangCodeModelPlugin::initialize()
|
||||
{
|
||||
TaskHub::addCategory({Constants::TASK_CATEGORY_DIAGNOSTICS, Tr::tr("Clang Code Model")});
|
||||
CppEditor::CppModelManager::instance()->activateClangCodeModel(
|
||||
CppEditor::CppModelManager::activateClangCodeModel(
|
||||
std::make_unique<ClangModelManagerSupport>());
|
||||
createCompilationDBAction();
|
||||
|
||||
@@ -135,8 +135,8 @@ void ClangCodeModelPlugin::createCompilationDBAction()
|
||||
"No active project.");
|
||||
return;
|
||||
}
|
||||
const CppEditor::ProjectInfo::ConstPtr projectInfo = CppEditor::CppModelManager::instance()
|
||||
->projectInfo(project);
|
||||
const CppEditor::ProjectInfo::ConstPtr projectInfo =
|
||||
CppEditor::CppModelManager::projectInfo(project);
|
||||
if (!projectInfo || projectInfo->projectParts().isEmpty()) {
|
||||
MessageManager::writeDisrupting("Cannot generate compilation database: "
|
||||
"Project has no C/C++ project parts.");
|
||||
|
||||
Reference in New Issue
Block a user