Commit 76824625 authored by Christiaan Janssen's avatar Christiaan Janssen
Browse files

QmlInspector: break selection loop on cursor change

Reviewed-by: Kai Koehne
parent 8dd88de0
......@@ -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();
......
......@@ -180,6 +180,7 @@ private:
static InspectorUi *m_instance;
bool m_selectionCallbackExpected;
bool m_cursorPositionChangedExternally;
};
} // Internal
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment