forked from qt-creator/qt-creator
QmlJSInspector: Query Root Objects
As parentIds are now known, query only root objects initially and build the object tree lazily. Change-Id: Ic6895ad8a0dd8dc2a2b1d8aa71fdf6766974eea5 Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
@@ -528,7 +528,7 @@ quint32 ClientProxy::fetchContextObject(const QmlDebugObjectReference& obj)
|
||||
return m_engineClient->queryObject(obj);
|
||||
}
|
||||
|
||||
void ClientProxy::fetchContextObjectRecursive(
|
||||
void ClientProxy::fetchRootObjects(
|
||||
const QmlDebugContextReference& context, bool clear)
|
||||
{
|
||||
if (!isConnected())
|
||||
@@ -541,16 +541,19 @@ void ClientProxy::fetchContextObjectRecursive(
|
||||
quint32 queryId = 0;
|
||||
using namespace QmlJsDebugClient::Constants;
|
||||
if (m_engineClient->objectName() == QML_DEBUGGER &&
|
||||
m_engineClient->serviceVersion() >= CURRENT_SUPPORTED_VERSION)
|
||||
m_engineClient->serviceVersion() >= CURRENT_SUPPORTED_VERSION) {
|
||||
//Fetch only root objects
|
||||
if (obj.parentId() == -1)
|
||||
queryId = fetchContextObject(obj);
|
||||
else
|
||||
} else {
|
||||
queryId = m_engineClient->queryObjectRecursive(obj);
|
||||
}
|
||||
|
||||
if (queryId)
|
||||
m_objectTreeQueryIds << queryId;
|
||||
}
|
||||
foreach (const QmlDebugContextReference& child, context.contexts()) {
|
||||
fetchContextObjectRecursive(child, false);
|
||||
fetchRootObjects(child, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -96,7 +96,7 @@ public:
|
||||
|
||||
quint32 fetchContextObject(const QmlDebugObjectReference& obj);
|
||||
void addObjectToTree(const QmlDebugObjectReference &obj);
|
||||
void fetchContextObjectRecursive(const QmlDebugContextReference &context, bool clear);
|
||||
void fetchRootObjects(const QmlDebugContextReference &context, bool clear);
|
||||
void insertObjectInTreeIfNeeded(const QmlDebugObjectReference &object);
|
||||
|
||||
QDeclarativeDebugClient *qmlDebugger() const;
|
||||
|
@@ -371,7 +371,7 @@ void InspectorUi::disconnected()
|
||||
void InspectorUi::onRootContext(const QVariant &value)
|
||||
{
|
||||
if (m_crumblePath->dataForLastIndex().toInt() < 0) {
|
||||
m_clientProxy->fetchContextObjectRecursive(
|
||||
m_clientProxy->fetchRootObjects(
|
||||
qvariant_cast<QmlDebugContextReference>(
|
||||
value), true);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user