diff options
author | Sandro S. Andrade <sandroandrade@kde.org> | 2013-10-03 09:32:07 -0400 |
---|---|---|
committer | Sandro S. Andrade <sandroandrade@kde.org> | 2013-10-03 15:36:07 +0200 |
commit | 356292395d2be4c59c81bba6787af1317046af5b (patch) | |
tree | 4e6e7d353111b06db1ecd725439f9cccb639ab54 /src/uml/qumlelement.cpp | |
parent | 4d19c1223d4320b0db0261eb6d9904c5be480177 (diff) |
Fix xmi-write to work with new UML metamodel implementation
Change-Id: Ic46debecfdd68f1c38b22cee54c663c22db13cd6
Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'src/uml/qumlelement.cpp')
-rw-r--r-- | src/uml/qumlelement.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/uml/qumlelement.cpp b/src/uml/qumlelement.cpp index b8c87228..97138e84 100644 --- a/src/uml/qumlelement.cpp +++ b/src/uml/qumlelement.cpp @@ -156,7 +156,7 @@ void QUmlElement::setOwner(QUmlElement *owner) if (_owner != owner) { _owner = owner; - if (owner->asQObject() && this->asQObject()) + if (owner && owner->asQObject() && this->asQObject()) QObject::connect(owner->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setOwner())); } } @@ -168,9 +168,9 @@ void QUmlElement::setOwner(QUmlElement *owner) */ QSet<QUmlElement *> QUmlElement::allOwnedElements() const { - qWarning("UmlElement::allOwnedElements(): to be implemented (operation)"); - - return QSet<QUmlElement *> (); + QSet<QUmlElement *> allOwnedElements_; + allOwnedElements(allOwnedElements_); + return allOwnedElements_; } /*! @@ -178,9 +178,7 @@ QSet<QUmlElement *> QUmlElement::allOwnedElements() const */ bool QUmlElement::mustBeOwned() const { - qWarning("UmlElement::mustBeOwned(): to be implemented (operation)"); - - return bool (); + return true; } void QUmlElement::setPropertyData() @@ -205,3 +203,10 @@ void QUmlElement::setPropertyData() } +void QUmlElement::allOwnedElements(QSet<QUmlElement *> &allOwnedElements_) const +{ + allOwnedElements_.unite(_ownedElement); + foreach (QUmlElement *element, _ownedElement) + element->allOwnedElements(allOwnedElements_); +} + |