Commit 55c3e747 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Changed the way IDs are set, to prevent duplicate IDs in the model.

parent a0af55e7
......@@ -129,11 +129,19 @@ void TextToModelMerger::syncNode(ModelNode &modelNode, const QmlDomObject &domOb
domObjectId = domIdProperty.value().toLiteral().literal();
if (domObjectId.isEmpty()) {
if (!modelNode.id().isEmpty())
if (!modelNode.id().isEmpty()) {
ModelNode existingNodeWithId = m_rewriterView->modelNodeForId(domObjectId);
if (existingNodeWithId.isValid())
existingNodeWithId.setId(QString());
differenceHandler.idsDiffer(modelNode, domObjectId);
}
} else {
if (modelNode.id() != domObjectId)
if (modelNode.id() != domObjectId) {
ModelNode existingNodeWithId = m_rewriterView->modelNodeForId(domObjectId);
if (existingNodeWithId.isValid())
existingNodeWithId.setId(QString());
differenceHandler.idsDiffer(modelNode, domObjectId);
}
}
}
......
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