QmlInspector: break selection loop on cursor change

Reviewed-by: Kai Koehne
This commit is contained in:
Christiaan Janssen
2011-03-08 11:36:02 +01:00
parent 315e18d79a
commit ecce5bca6f
2 changed files with 8 additions and 0 deletions

View File

@@ -155,6 +155,7 @@ InspectorUi::InspectorUi(QObject *parent)
, m_debugQuery(0) , m_debugQuery(0)
, m_debugProject(0) , m_debugProject(0)
, m_selectionCallbackExpected(false) , m_selectionCallbackExpected(false)
, m_cursorPositionChangedExternally(false)
{ {
m_instance = this; m_instance = this;
m_toolBar = new QmlInspectorToolBar(this); m_toolBar = new QmlInspectorToolBar(this);
@@ -385,6 +386,7 @@ void InspectorUi::changeSelectedItems(const QList<QDeclarativeDebugObjectReferen
m_selectionCallbackExpected = false; m_selectionCallbackExpected = false;
return; return;
} }
m_cursorPositionChangedExternally = true;
// QmlJSLiveTextPreview doesn't provide valid references, only correct debugIds. We need to remap them // QmlJSLiveTextPreview doesn't provide valid references, only correct debugIds. We need to remap them
QList <QDeclarativeDebugObjectReference> realList; QList <QDeclarativeDebugObjectReference> realList;
@@ -671,6 +673,11 @@ QDeclarativeDebugObjectReference InspectorUi::objectReferenceForLocation(const Q
void InspectorUi::gotoObjectReferenceDefinition(const QDeclarativeDebugObjectReference &obj) void InspectorUi::gotoObjectReferenceDefinition(const QDeclarativeDebugObjectReference &obj)
{ {
if (m_cursorPositionChangedExternally) {
m_cursorPositionChangedExternally = false;
return;
}
QDeclarativeDebugFileReference source = obj.source(); QDeclarativeDebugFileReference source = obj.source();
QString fileName = source.url().toLocalFile(); QString fileName = source.url().toLocalFile();

View File

@@ -180,6 +180,7 @@ private:
static InspectorUi *m_instance; static InspectorUi *m_instance;
bool m_selectionCallbackExpected; bool m_selectionCallbackExpected;
bool m_cursorPositionChangedExternally;
}; };
} // Internal } // Internal