Commit 40eea090 authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner.NodeInstances: Filter duplicate nodes from list

parent 146d9ede
...@@ -926,20 +926,21 @@ void NodeInstanceView::informationChanged(const InformationChangedCommand &comma ...@@ -926,20 +926,21 @@ void NodeInstanceView::informationChanged(const InformationChangedCommand &comma
if (!model()) if (!model())
return; return;
QList<ModelNode> informationChangedList; QVector<ModelNode> informationChangedVector;
foreach(const InformationContainer &container, command.informations()) { foreach(const InformationContainer &container, command.informations()) {
if (hasInstanceForId(container.instanceId())) { if (hasInstanceForId(container.instanceId())) {
NodeInstance instance = instanceForId(container.instanceId()); NodeInstance instance = instanceForId(container.instanceId());
if (instance.isValid()) { if (instance.isValid()) {
instance.setInformation(container.name(), container.information(), container.secondInformation(), container.thirdInformation()); instance.setInformation(container.name(), container.information(), container.secondInformation(), container.thirdInformation());
informationChangedList.append(instance.modelNode()); if (!informationChangedVector.contains(instance.modelNode()))
informationChangedVector.append(instance.modelNode());
} }
} }
} }
if (!informationChangedList.isEmpty()) if (!informationChangedVector.isEmpty())
emitCustomNotification("__instance information changed__", informationChangedList); emitCustomNotification("__instance information changed__", informationChangedVector.toList());
} }
QImage NodeInstanceView::statePreviewImage(const ModelNode &stateNode) const QImage NodeInstanceView::statePreviewImage(const ModelNode &stateNode) const
......
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