From e43496944607a975c6ce2a5844bdc8bc861f02ee Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Thu, 18 Aug 2011 11:22:42 +0200 Subject: [PATCH] C++ function link: Unbreak same-file links. Change-Id: Icfb71278c796dfb8668de423a691c7dc90e9531f Reviewed-on: http://codereview.qt.nokia.com/3170 Reviewed-by: Roberto Raggi --- src/plugins/cppeditor/cppeditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 8998fa3aa57..c32b2320042 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -2306,7 +2306,7 @@ void CPPEditorWidget::onFunctionDeclDefLinkFound(QSharedPointertargetFile->fileName()); - if (targetEditor) { + if (targetEditor && targetEditor != this) { connect(targetEditor, SIGNAL(textChanged()), this, SLOT(abortDeclDefLink())); } @@ -2329,7 +2329,7 @@ void CPPEditorWidget::abortDeclDefLink() // undo connect from onFunctionDeclDefLinkFound TextEditor::BaseTextEditorWidget *targetEditor = TextEditor::RefactoringChanges::editorForFile(m_declDefLink->targetFile->fileName()); - if (targetEditor) { + if (targetEditor && targetEditor != this) { disconnect(targetEditor, SIGNAL(textChanged()), this, SLOT(abortDeclDefLink())); }