Remove TextEditor::RefactoringChanges::editorForFile

This also fixes a bug with setting text cursor in InsertDefOperation in
case of split editors (where the cursor could be set in a non-active
editor on the target file).

Change-Id: I1c011386537bc88a89d4d66bec79dfe06faac3c6
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Eike Ziller
2013-07-18 09:40:50 +02:00
parent e782e72341
commit 7b4895d7ec
4 changed files with 24 additions and 31 deletions

View File

@@ -2592,8 +2592,8 @@ public:
m_loc.prefix().count(QLatin1String("\n")) + 2);
c.movePosition(QTextCursor::EndOfLine);
if (m_defpos == DefPosImplementationFile) {
if (BaseTextEditorWidget *editor = refactoring.editorForFile(m_loc.fileName()))
editor->setTextCursor(c);
if (targetFile->editor())
targetFile->editor()->setTextCursor(c);
} else {
assistInterface()->editor()->setTextCursor(c);
}