diff --git a/src/plugins/qmljsinspector/qmljsinspector.cpp b/src/plugins/qmljsinspector/qmljsinspector.cpp index 174ca43872e5e5aab384a12e4d95844cfae2ba46..6798e46327aff3e455f09d3665e5e36093fcf7ef 100644 --- a/src/plugins/qmljsinspector/qmljsinspector.cpp +++ b/src/plugins/qmljsinspector/qmljsinspector.cpp @@ -138,6 +138,7 @@ InspectorUi::InspectorUi(QObject *parent) , m_clientProxy(0) , m_qmlEngine(0) , m_debugQuery(0) + , m_lastSelectedDebugId(-1) , m_debugProject(0) { m_instance = this; @@ -350,6 +351,18 @@ void InspectorUi::updateEngineList() void InspectorUi::changeSelectedItems(const QList<QDeclarativeDebugObjectReference> &objects) { + if (m_lastSelectedDebugId >= 0) { + foreach (QDeclarativeDebugObjectReference ref, objects) { + if (ref.debugId() == m_lastSelectedDebugId) { + // this is only the 'call back' after we have programatically set a new cursor + // position in + m_lastSelectedDebugId = -1; + return; + } + } + m_lastSelectedDebugId = -1; + } + m_clientProxy->setSelectedItemsByObjectId(objects); } @@ -548,6 +561,8 @@ void InspectorUi::gotoObjectReferenceDefinition(const QDeclarativeDebugObjectRef TextEditor::ITextEditor *textEditor = qobject_cast<TextEditor::ITextEditor*>(editor); if (textEditor) { + m_lastSelectedDebugId = obj.debugId(); + editorManager->addCurrentPositionToNavigationHistory(); textEditor->gotoLine(source.lineNumber()); textEditor->widget()->setFocus(); diff --git a/src/plugins/qmljsinspector/qmljsinspector.h b/src/plugins/qmljsinspector/qmljsinspector.h index d290a27b4ee717f730adc9bc7fc81cc3d695e93f..99d6bfafe8f43472869301c19def130fcf67c633 100644 --- a/src/plugins/qmljsinspector/qmljsinspector.h +++ b/src/plugins/qmljsinspector/qmljsinspector.h @@ -162,6 +162,7 @@ private: ClientProxy *m_clientProxy; Debugger::QmlEngine *m_qmlEngine; QDeclarativeDebugExpressionQuery *m_debugQuery; + int m_lastSelectedDebugId; // Qml/JS integration QHash<QString, QmlJSLiveTextPreview *> m_textPreviews;