mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-15 10:04:13 +02:00
Warn when a terminal strip lists a terminal no symbol has
A terminal strip saved with a terminal whose symbol is gone left that terminal out without a word. It still does, and says so in the log. The same happens with every folio built: the database is filled from the document, so a symbol in the file is never missing from it. Review of #1472 (scorpio810, point 8). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1034,6 +1034,7 @@ bool TerminalStrip::fromXml(QDomElement &xml_element)
|
||||
for (auto &xml_real : QETXML::findInDomElement(xml_physical, RealTerminal::xmlTagName()))
|
||||
{
|
||||
const auto uuid_ = QUuid(xml_real.attribute(QStringLiteral("element_uuid")));
|
||||
bool found = false;
|
||||
for (auto terminal_elmt : std::as_const(free_terminals))
|
||||
{
|
||||
if (terminal_elmt->uuid() == uuid_)
|
||||
@@ -1042,9 +1043,15 @@ bool TerminalStrip::fromXml(QDomElement &xml_element)
|
||||
//Remove the actual terminal element from the vector, they dicrease the size
|
||||
//of the vector and so each iteration have less terminal element to check
|
||||
free_terminals.removeOne(terminal_elmt);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
qWarning() << "TerminalStrip::fromXml: strip" << name()
|
||||
<< "lists terminal" << uuid_.toString()
|
||||
<< "but no free terminal symbol has this uuid; it is left out";
|
||||
}
|
||||
}
|
||||
|
||||
if (!real_t_vector.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user