Commit 9b68e81f authored by Aurindam Jana's avatar Aurindam Jana
Browse files

Inspector: Select only known objects for 4.x



Change-Id: If052b4a018d5d0c20086a0251d7d1b206e7d4192
Reviewed-by: default avatarChristiaan Janssen <christiaan.janssen@digia.com>
parent 6f7ce3f4
...@@ -147,9 +147,16 @@ bool QmlInspectorAgent::selectObjectInTree(int debugId) ...@@ -147,9 +147,16 @@ bool QmlInspectorAgent::selectObjectInTree(int debugId)
m_objectToSelect = 0; m_objectToSelect = 0;
return true; return true;
} else { } else {
// we've to fetch it // we may have to fetch it
m_objectToSelect = debugId; m_objectToSelect = debugId;
fetchObject(debugId); using namespace QmlDebug::Constants;
if (m_engineClient->objectName() == QLatin1String(QDECLARATIVE_ENGINE)) {
// reset current Selection
QByteArray root = m_debuggerEngine->watchHandler()->watchData(QModelIndex())->iname;
m_debuggerEngine->watchHandler()->setCurrentItem(root);
} else {
fetchObject(debugId);
}
return false; return false;
} }
} }
...@@ -708,9 +715,9 @@ void QmlInspectorAgent::insertObjectInTree(const ObjectReference &object) ...@@ -708,9 +715,9 @@ void QmlInspectorAgent::insertObjectInTree(const ObjectReference &object)
emit objectTreeUpdated(); emit objectTreeUpdated();
emit objectFetched(last); emit objectFetched(last);
if (m_objectToSelect == last.debugId()) { if (m_objectToSelect == last.debugId() || m_debugIdToIname.keys().contains(m_objectToSelect)) {
// select item in view // select item in view
QByteArray iname = m_debugIdToIname.value(last.debugId()); QByteArray iname = m_debugIdToIname.value(m_objectToSelect);
if (debug) if (debug)
qDebug() << " selecting" << iname << "in tree"; qDebug() << " selecting" << iname << "in tree";
watchHandler->setCurrentItem(iname); watchHandler->setCurrentItem(iname);
...@@ -808,6 +815,7 @@ QList<WatchData> QmlInspectorAgent::buildWatchData(const ObjectReference &obj, ...@@ -808,6 +815,7 @@ QList<WatchData> QmlInspectorAgent::buildWatchData(const ObjectReference &obj,
list.append(objWatch); list.append(objWatch);
addObjectWatch(objWatch.id); addObjectWatch(objWatch.id);
m_debugIdToIname.insert(objDebugId, objIname);
} }
if (!m_debuggerEngine->watchHandler()->isExpandedIName(objIname)) { if (!m_debuggerEngine->watchHandler()->isExpandedIName(objIname)) {
...@@ -848,7 +856,6 @@ QList<WatchData> QmlInspectorAgent::buildWatchData(const ObjectReference &obj, ...@@ -848,7 +856,6 @@ QList<WatchData> QmlInspectorAgent::buildWatchData(const ObjectReference &obj,
propertyWatch.setHasChildren(false); propertyWatch.setHasChildren(false);
list.append(propertyWatch); list.append(propertyWatch);
} }
m_debugIdToIname.insert(objDebugId, objIname);
} }
// recurse // recurse
......
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