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:
hjk
2023-07-12 09:47:29 +02:00
parent 8f82e76ba1
commit 0b83f110f4
80 changed files with 505 additions and 619 deletions

View File

@@ -1899,10 +1899,9 @@ ProjectExplorer::HeaderPaths relevantHeaderPaths(const QString &filePath)
{
ProjectExplorer::HeaderPaths headerPaths;
CppModelManager *modelManager = CppModelManager::instance();
const QList<ProjectPart::ConstPtr> projectParts = modelManager->projectPart(filePath);
const QList<ProjectPart::ConstPtr> projectParts = CppModelManager::projectPart(filePath);
if (projectParts.isEmpty()) { // Not part of any project, better use all include paths than none
headerPaths += modelManager->headerPaths();
headerPaths += CppModelManager::headerPaths();
} else {
for (const ProjectPart::ConstPtr &part : projectParts)
headerPaths += part->headerPaths;
@@ -1997,7 +1996,7 @@ QList<IndexItem::Ptr> matchName(const Name *name, QString *className)
QString simpleName;
QList<IndexItem::Ptr> matches;
CppLocatorData *locatorData = CppModelManager::instance()->locatorData();
CppLocatorData *locatorData = CppModelManager::locatorData();
const Overview oo;
if (const QualifiedNameId *qualifiedName = name->asQualifiedNameId()) {
const Name *name = qualifiedName->name();