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:
Jarek Kobus
2022-06-02 00:42:28 +02:00
parent b9f0663741
commit 8cd9a2dd12
8 changed files with 12 additions and 25 deletions

View File

@@ -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);
}