forked from qt-creator/qt-creator
ModelManagerSupport: Get rid of UsagesCallback from findUsages()
It's not used currently. Change-Id: Ic3625b0f3c53c09089a361453f29ac639692cffb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -792,23 +792,16 @@ void CppEditorWidget::findUsages()
|
||||
void CppEditorWidget::findUsages(QTextCursor cursor)
|
||||
{
|
||||
// 'this' in cursorInEditor is never used (and must never be used) asynchronously.
|
||||
const CursorInEditor cursorInEditor{cursor, textDocument()->filePath(), this,
|
||||
textDocument()};
|
||||
const CursorInEditor cursorInEditor{cursor, textDocument()->filePath(), this, textDocument()};
|
||||
QPointer<CppEditorWidget> cppEditorWidget = this;
|
||||
d->m_modelManager->findUsages(cursorInEditor,
|
||||
[=](const Usages &usages) {
|
||||
if (!cppEditorWidget)
|
||||
return;
|
||||
findRenameCallback(cppEditorWidget.data(), cursor, usages);
|
||||
});
|
||||
d->m_modelManager->findUsages(cursorInEditor);
|
||||
}
|
||||
|
||||
void CppEditorWidget::renameUsages(const QString &replacement, QTextCursor cursor)
|
||||
{
|
||||
if (cursor.isNull())
|
||||
cursor = textCursor();
|
||||
CursorInEditor cursorInEditor{cursor, textDocument()->filePath(), this,
|
||||
textDocument()};
|
||||
CursorInEditor cursorInEditor{cursor, textDocument()->filePath(), this, textDocument()};
|
||||
QPointer<CppEditorWidget> cppEditorWidget = this;
|
||||
d->m_modelManager->globalRename(cursorInEditor, replacement);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user