if no uuid for the terminal is available, use write the id of the terminal to the xml file, otherwise no connection can be done after saving

This commit is contained in:
Martin Marmsoler
2020-10-02 14:58:33 +02:00
parent 9684d753ec
commit c8691b243b
4 changed files with 40 additions and 4 deletions

View File

@@ -662,6 +662,11 @@ bool Element::fromXml(QDomElement &e, QHash<int, Terminal *> &table_id_adr, bool
qFuzzyCompare(dockPos1.y(), dockPos2.y()) &&
p->orientation() == diagramTerminal.orientation()) { // check if the part in the collection is the same as in the diagram stored
qDebug() << "Matching Terminal found.";
// store id for legacy purpose, because when opening a old project in the collection the terminal does not have an uuid. Therefore the id must be used
if (p->uuid().isNull()) {
p->setID(qde.attribute("id").toInt());
}
priv_id_adr.insert(qde.attribute("id").toInt(), p);
terminal_trouvee = true;
// We used to break here, because we did not expect