Commit b08e5a9b authored by hjk's avatar hjk

Debugger: Reduce QML engine <-> watch handler interaction

Change-Id: Ia00f0747f40b18e99da2a7824d3e490291ab0b23
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 15f1ca90
......@@ -784,33 +784,28 @@ void QmlInspectorAgent::addWatchData(const ObjectReference &obj,
// properties
if (append && obj.properties().count()) {
WatchData propertiesWatch;
propertiesWatch.id = objDebugId;
propertiesWatch.exp = "";
propertiesWatch.name = tr("Properties");
propertiesWatch.iname = objIname + ".[properties]";
propertiesWatch.type = "";
propertiesWatch.value = _("list");
propertiesWatch.setHasChildren(true);
propertiesWatch.setAllUnneeded();
m_debuggerEngine->watchHandler()->insertData(propertiesWatch);
QByteArray iname = objIname + ".[properties]";
auto propertiesWatch = new WatchItem(iname, tr("Properties"));
propertiesWatch->d.id = objDebugId;
propertiesWatch->d.value = _("list");
propertiesWatch->d.setHasChildren(true);
propertiesWatch->d.setAllUnneeded();
foreach (const PropertyReference &property, obj.properties()) {
const QString propertyName = property.name();
if (propertyName.isEmpty())
continue;
WatchData propertyWatch;
propertyWatch.id = objDebugId;
propertyWatch.exp = propertyName.toLatin1();
propertyWatch.name = propertyName;
propertyWatch.iname = buildIName(propertiesWatch.iname, propertyName);
propertyWatch.type = property.valueTypeName().toLatin1();
propertyWatch.value = property.value().toString();
propertyWatch.setAllUnneeded();
propertyWatch.setHasChildren(false);
m_debuggerEngine->watchHandler()->insertData(propertyWatch);
auto propertyWatch = new WatchItem(buildIName(iname, propertyName), propertyName);
propertyWatch->d.id = objDebugId;
propertyWatch->d.exp = propertyName.toLatin1();
propertyWatch->d.type = property.valueTypeName().toLatin1();
propertyWatch->d.value = property.value().toString();
propertyWatch->d.setAllUnneeded();
propertyWatch->d.setHasChildren(false);
propertiesWatch->appendChild(propertyWatch);
}
m_debuggerEngine->watchHandler()->insertItem(propertiesWatch);
}
// 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