Commit 9e8cd1eb authored by Aurindam Jana's avatar Aurindam Jana Committed by Kai Koehne

QmlConsole: Check for duplicate children

When constructing the console item tree, check for
duplicate entries.

Change-Id: Ibc5aa150287ef5e2ee4b691a71bb170308a1fde7
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
Reviewed-by: default avatarKai Koehne <kai.koehne@digia.com>
parent fd685138
......@@ -1770,13 +1770,19 @@ QmlJS::ConsoleItem *constructLogItemTree(QmlJS::ConsoleItem *parent,
ConsoleItem *item = new ConsoleItem(parent, ConsoleItem::UndefinedType, text);
QSet<QString> childrenFetched;
foreach (const QVariant &property, objectData.properties) {
const QmlV8ObjectData childObjectData = extractData(property, refsVal);
if (childObjectData.handle == objectData.handle)
continue;
ConsoleItem *child = constructLogItemTree(item, childObjectData, refsVal);
if (child)
if (child) {
const QString text = child->text();
if (childrenFetched.contains(text))
continue;
childrenFetched.insert(text);
item->insertChild(child, sorted);
}
}
return item;
......
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