move find usages to TextEditor

In preperation for supporting find usages by the language client plugin

Task-number: QTCREATORBUG-21577
Change-Id: I7a6da3a9d53478c1d486e0ddc5829c9ea09a2a20
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
David Schulz
2018-11-28 07:26:14 +01:00
parent ccd5955843
commit 95cba448a1
13 changed files with 28 additions and 34 deletions

View File

@@ -431,10 +431,13 @@ static void findRenameCallback(CppEditorWidget *widget,
search->popup();
}
void CppEditorWidget::findUsages()
{
findUsages(textCursor());
}
void CppEditorWidget::findUsages(QTextCursor cursor)
{
if (cursor.isNull())
cursor = textCursor();
// 'this' in cursorInEditor is never used (and must never be used) asynchronously.
const CppTools::CursorInEditor cursorInEditor{cursor, textDocument()->filePath(), this};
QPointer<CppEditorWidget> cppEditorWidget = this;