summaryrefslogtreecommitdiff
path: root/src/plugins/qmljsinspector
diff options
context:
space:
mode:
authorChristiaan Janssen <christiaan.janssen@nokia.com>2011-03-08 11:36:02 +0100
committerChristiaan Janssen <christiaan.janssen@nokia.com>2011-03-08 13:26:29 +0100
commitecce5bca6f73345ad01a8e2ecfeb3d07425bc360 (patch)
tree045823a428c62b4f264fb130fc1c9c7d0cafa422 /src/plugins/qmljsinspector
parent315e18d79a1b8a4a3d7e27c005e606b9238afe94 (diff)
downloadqt-creator-ecce5bca6f73345ad01a8e2ecfeb3d07425bc360.tar.gz
QmlInspector: break selection loop on cursor change
Reviewed-by: Kai Koehne
Diffstat (limited to 'src/plugins/qmljsinspector')
-rw-r--r--src/plugins/qmljsinspector/qmljsinspector.cpp7
-rw-r--r--src/plugins/qmljsinspector/qmljsinspector.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/qmljsinspector/qmljsinspector.cpp b/src/plugins/qmljsinspector/qmljsinspector.cpp
index f8b0467563..1a2ab03271 100644
--- a/src/plugins/qmljsinspector/qmljsinspector.cpp
+++ b/src/plugins/qmljsinspector/qmljsinspector.cpp
@@ -155,6 +155,7 @@ InspectorUi::InspectorUi(QObject *parent)
, m_debugQuery(0)
, m_debugProject(0)
, m_selectionCallbackExpected(false)
+ , m_cursorPositionChangedExternally(false)
{
m_instance = this;
m_toolBar = new QmlInspectorToolBar(this);
@@ -385,6 +386,7 @@ void InspectorUi::changeSelectedItems(const QList<QDeclarativeDebugObjectReferen
m_selectionCallbackExpected = false;
return;
}
+ m_cursorPositionChangedExternally = true;
// QmlJSLiveTextPreview doesn't provide valid references, only correct debugIds. We need to remap them
QList <QDeclarativeDebugObjectReference> realList;
@@ -671,6 +673,11 @@ QDeclarativeDebugObjectReference InspectorUi::objectReferenceForLocation(const Q
void InspectorUi::gotoObjectReferenceDefinition(const QDeclarativeDebugObjectReference &obj)
{
+ if (m_cursorPositionChangedExternally) {
+ m_cursorPositionChangedExternally = false;
+ return;
+ }
+
QDeclarativeDebugFileReference source = obj.source();
QString fileName = source.url().toLocalFile();
diff --git a/src/plugins/qmljsinspector/qmljsinspector.h b/src/plugins/qmljsinspector/qmljsinspector.h
index afef95c7ff..4beadc6b55 100644
--- a/src/plugins/qmljsinspector/qmljsinspector.h
+++ b/src/plugins/qmljsinspector/qmljsinspector.h
@@ -180,6 +180,7 @@ private:
static InspectorUi *m_instance;
bool m_selectionCallbackExpected;
+ bool m_cursorPositionChangedExternally;
};
} // Internal