mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Remove the real terminal uuid, and use instead the uuid of the terminal element itself
This commit is contained in:
@@ -263,15 +263,6 @@ QUuid RealTerminal::elementUuid() const {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief uuid
|
||||
* @return the uuid of this real terminal
|
||||
*/
|
||||
QUuid RealTerminal::uuid() const {
|
||||
return elementUuid();
|
||||
return m_uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief RealTerminal::RealTerminal::xmlTagName
|
||||
* @return
|
||||
|
||||
@@ -77,13 +77,11 @@ class RealTerminal
|
||||
|
||||
Element* element() const;
|
||||
QUuid elementUuid() const;
|
||||
QUuid uuid() const;
|
||||
|
||||
static QString xmlTagName();
|
||||
|
||||
private :
|
||||
QPointer<Element> m_element;
|
||||
QUuid m_uuid = QUuid::createUuid();
|
||||
QWeakPointer<RealTerminal> m_this_weak;
|
||||
QSharedPointer<PhysicalTerminal> m_physical_terminal;
|
||||
};
|
||||
|
||||
@@ -250,7 +250,7 @@ QSharedPointer<RealTerminal> TerminalStrip::realTerminal(Element *terminal) cons
|
||||
QSharedPointer<RealTerminal> TerminalStrip::realTerminalForUuid(const QUuid &uuid) const
|
||||
{
|
||||
for (const auto &t : qAsConst(m_real_terminals)) {
|
||||
if (t->uuid() == uuid) {
|
||||
if (t->elementUuid() == uuid) {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ QDomElement TerminalStripBridge::toXml(QDomDocument &parent_document) const
|
||||
if (real_t)
|
||||
{
|
||||
auto terminal_elmt = parent_document.createElement(QStringLiteral("real_terminal"));
|
||||
terminal_elmt.setAttribute(QStringLiteral("uuid"), real_t->uuid().toString());
|
||||
terminal_elmt.setAttribute(QStringLiteral("uuid"), real_t->elementUuid().toString());
|
||||
terminals_elmt.appendChild(terminal_elmt);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user