CppEditorWidget: Remove private refactoringEngine() method

d->m_modelManager can be used directly instead.

Change-Id: I11158ede3bb827ebed88706d0bfaab4e0f142f0a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Bernhard Beschow
2017-10-22 22:17:49 +02:00
parent e15beff0cb
commit 886c76e10f
2 changed files with 19 additions and 26 deletions

View File

@@ -441,12 +441,12 @@ void CppEditorWidget::findUsages(QTextCursor cursor)
// 'this' in cursorInEditor is never used (and must never be used) asynchronously.
const CppTools::CursorInEditor cursorInEditor{cursor, textDocument()->filePath(), this};
QPointer<CppEditorWidget> cppEditorWidget = this;
refactoringEngine().findUsages(cursorInEditor,
[=](const CppTools::Usages &usages) {
if (!cppEditorWidget)
return;
findRenameCallback(cppEditorWidget.data(), cursor, usages);
});
d->m_modelManager->findUsages(cursorInEditor,
[=](const CppTools::Usages &usages) {
if (!cppEditorWidget)
return;
findRenameCallback(cppEditorWidget.data(), cursor, usages);
});
}
void CppEditorWidget::renameUsages(const QString &replacement, QTextCursor cursor)
@@ -455,14 +455,14 @@ void CppEditorWidget::renameUsages(const QString &replacement, QTextCursor curso
cursor = textCursor();
CppTools::CursorInEditor cursorInEditor{cursor, textDocument()->filePath(), this};
QPointer<CppEditorWidget> cppEditorWidget = this;
refactoringEngine().globalRename(cursorInEditor,
[=](const CppTools::Usages &usages) {
if (!cppEditorWidget)
return;
findRenameCallback(cppEditorWidget.data(), cursor, usages,
true, replacement);
},
replacement);
d->m_modelManager->globalRename(cursorInEditor,
[=](const CppTools::Usages &usages) {
if (!cppEditorWidget)
return;
findRenameCallback(cppEditorWidget.data(), cursor, usages,
true, replacement);
},
replacement);
}
bool CppEditorWidget::selectBlockUp()
@@ -641,11 +641,11 @@ void CppEditorWidget::renameSymbolUnderCursor()
};
viewport()->setCursor(Qt::BusyCursor);
refactoringEngine().startLocalRenaming(CppTools::CursorInEditor{textCursor(),
textDocument()->filePath(),
this},
projPart,
std::move(renameSymbols));
d->m_modelManager->startLocalRenaming(CppTools::CursorInEditor{textCursor(),
textDocument()->filePath(),
this},
projPart,
std::move(renameSymbols));
}
void CppEditorWidget::updatePreprocessorButtonTooltip()
@@ -773,11 +773,6 @@ RefactorMarkers CppEditorWidget::refactorMarkersWithoutClangMarkers() const
return clearedRefactorMarkers;
}
RefactoringEngineInterface &CppEditorWidget::refactoringEngine() const
{
return *d->m_modelManager;
}
CppTools::FollowSymbolInterface &CppEditorWidget::followSymbolInterface() const
{
return d->m_modelManager->followSymbolInterface();