summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppmodelmanager.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2021-05-19 11:22:50 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2021-05-19 11:32:31 +0000
commit7650447805d56c064de2bc7ec53c068f572ed5cc (patch)
treec74525c4f679c81258956a56c3b57e7e4f8823d0 /src/plugins/cpptools/cppmodelmanager.cpp
parentb087897b428c2bfbf1d435cac50a851532ad0152 (diff)
downloadqt-creator-7650447805d56c064de2bc7ec53c068f572ed5cc.tar.gz
CppTools: Remove unneeded parameter from getRefactoringEngine()
The ClangCodeModel's RefactoringEngine implements all operations now and thus does not have to be excluded anywhere. Change-Id: Ie3c2107d02e13463fc85f1a5319454db2c45915f Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/cpptools/cppmodelmanager.cpp')
-rw-r--r--src/plugins/cpptools/cppmodelmanager.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp
index 55c5098878..73c39e62f2 100644
--- a/src/plugins/cpptools/cppmodelmanager.cpp
+++ b/src/plugins/cpptools/cppmodelmanager.cpp
@@ -295,12 +295,11 @@ QString CppModelManager::editorConfigurationFileName()
return QLatin1String("<per-editor-defines>");
}
-static RefactoringEngineInterface *getRefactoringEngine(
- CppModelManagerPrivate::REHash &engines, bool excludeClangCodeModel = true)
+static RefactoringEngineInterface *getRefactoringEngine(CppModelManagerPrivate::REHash &engines)
{
QTC_ASSERT(!engines.empty(), return nullptr;);
RefactoringEngineInterface *currentEngine = engines[REType::BuiltIn];
- if (!excludeClangCodeModel && engines.find(REType::ClangCodeModel) != engines.end()) {
+ if (engines.find(REType::ClangCodeModel) != engines.end()) {
currentEngine = engines[REType::ClangCodeModel];
} else if (engines.find(REType::ClangRefactoring) != engines.end()) {
RefactoringEngineInterface *engine = engines[REType::ClangRefactoring];
@@ -314,8 +313,7 @@ void CppModelManager::startLocalRenaming(const CursorInEditor &data,
CppTools::ProjectPart *projectPart,
RenameCallback &&renameSymbolsCallback)
{
- RefactoringEngineInterface *engine = getRefactoringEngine(d->m_refactoringEngines,
- false);
+ RefactoringEngineInterface *engine = getRefactoringEngine(d->m_refactoringEngines);
QTC_ASSERT(engine, return;);
engine->startLocalRenaming(data, projectPart, std::move(renameSymbolsCallback));
}
@@ -323,7 +321,7 @@ void CppModelManager::startLocalRenaming(const CursorInEditor &data,
void CppModelManager::globalRename(const CursorInEditor &data, UsagesCallback &&renameCallback,
const QString &replacement)
{
- RefactoringEngineInterface *engine = getRefactoringEngine(d->m_refactoringEngines, false);
+ RefactoringEngineInterface *engine = getRefactoringEngine(d->m_refactoringEngines);
QTC_ASSERT(engine, return;);
engine->globalRename(data, std::move(renameCallback), replacement);
}
@@ -331,7 +329,7 @@ void CppModelManager::globalRename(const CursorInEditor &data, UsagesCallback &&
void CppModelManager::findUsages(const CppTools::CursorInEditor &data,
UsagesCallback &&showUsagesCallback) const
{
- RefactoringEngineInterface *engine = getRefactoringEngine(d->m_refactoringEngines, false);
+ RefactoringEngineInterface *engine = getRefactoringEngine(d->m_refactoringEngines);
QTC_ASSERT(engine, return;);
engine->findUsages(data, std::move(showUsagesCallback));
}
@@ -344,7 +342,7 @@ void CppModelManager::globalFollowSymbol(
SymbolFinder *symbolFinder,
bool inNextSplit) const
{
- RefactoringEngineInterface *engine = getRefactoringEngine(d->m_refactoringEngines, false);
+ RefactoringEngineInterface *engine = getRefactoringEngine(d->m_refactoringEngines);
QTC_ASSERT(engine, return;);
engine->globalFollowSymbol(data, std::move(processLinkCallback), snapshot, documentFromSemanticInfo,
symbolFinder, inNextSplit);