diff options
Diffstat (limited to 'umbrello/umbrello/association.cpp')
-rw-r--r-- | umbrello/umbrello/association.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/umbrello/umbrello/association.cpp b/umbrello/umbrello/association.cpp index eacc8d13..62f47a43 100644 --- a/umbrello/umbrello/association.cpp +++ b/umbrello/umbrello/association.cpp @@ -14,7 +14,7 @@ // qt/kde includes #include <kdebug.h> #include <klocale.h> -#include <qregexp.h> +#include <tqregexp.h> // app includes #include "classifier.h" #include "folder.h" @@ -78,7 +78,7 @@ bool UMLAssociation::operator==(UMLAssociation &rhs) { m_pRole[B] == rhs.m_pRole[B] ); } -const QString UMLAssociation::assocTypeStr[UMLAssociation::nAssocTypes] = { +const TQString UMLAssociation::assocTypeStr[UMLAssociation::nAssocTypes] = { /* The elements must be listed in the same order as in the Uml::Association_Type. */ i18n("Generalization"), // at_Generalization @@ -103,9 +103,9 @@ Uml::Association_Type UMLAssociation::getAssocType() const { return m_AssocType; } -QString UMLAssociation::toString ( ) const +TQString UMLAssociation::toString ( ) const { - QString string; + TQString string; if(m_pRole[A]) { string += m_pRole[A]->getObject()->getName(); @@ -122,7 +122,7 @@ QString UMLAssociation::toString ( ) const return string; } -QString UMLAssociation::typeAsString (Uml::Association_Type atype) +TQString UMLAssociation::typeAsString (Uml::Association_Type atype) { if (atype < atypeFirst || atype > atypeLast) return ""; @@ -159,9 +159,9 @@ bool UMLAssociation::resolveRef() { return false; } -void UMLAssociation::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) { +void UMLAssociation::saveToXMI( TQDomDocument & qDoc, TQDomElement & qElement ) { if (m_AssocType == Uml::at_Generalization) { - QDomElement assocElement = UMLObject::save("UML:Generalization", qDoc); + TQDomElement assocElement = UMLObject::save("UML:Generalization", qDoc); assocElement.setAttribute( "discriminator", "" ); assocElement.setAttribute( "child", ID2STR(getObjectId(A)) ); assocElement.setAttribute( "parent", ID2STR(getObjectId(B)) ); @@ -169,28 +169,28 @@ void UMLAssociation::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) { return; } if (m_AssocType == Uml::at_Realization) { - QDomElement assocElement = UMLObject::save("UML:Abstraction", qDoc); + TQDomElement assocElement = UMLObject::save("UML:Abstraction", qDoc); assocElement.setAttribute( "client", ID2STR(getObjectId(A)) ); assocElement.setAttribute( "supplier", ID2STR(getObjectId(B)) ); qElement.appendChild( assocElement ); return; } if (m_AssocType == Uml::at_Dependency) { - QDomElement assocElement = UMLObject::save("UML:Dependency", qDoc); + TQDomElement assocElement = UMLObject::save("UML:Dependency", qDoc); assocElement.setAttribute( "client", ID2STR(getObjectId(A)) ); assocElement.setAttribute( "supplier", ID2STR(getObjectId(B)) ); qElement.appendChild( assocElement ); return; } - QDomElement associationElement = UMLObject::save("UML:Association", qDoc); - QDomElement connElement = qDoc.createElement("UML:Association.connection"); + TQDomElement associationElement = UMLObject::save("UML:Association", qDoc); + TQDomElement connElement = qDoc.createElement("UML:Association.connection"); getUMLRole(A)->saveToXMI (qDoc, connElement); getUMLRole(B)->saveToXMI (qDoc, connElement); associationElement.appendChild (connElement); qElement.appendChild( associationElement ); } -bool UMLAssociation::load( QDomElement & element ) { +bool UMLAssociation::load( TQDomElement & element ) { if (getID() == Uml::id_None) return false; // old style XMI file. No real info in this association. @@ -200,10 +200,10 @@ bool UMLAssociation::load( QDomElement & element ) { m_AssocType == Uml::at_Realization || m_AssocType == Uml::at_Dependency) { for (unsigned r = Uml::A; r <= Uml::B; r++) { - const QString fetch = (m_AssocType == Uml::at_Generalization ? + const TQString fetch = (m_AssocType == Uml::at_Generalization ? r == Uml::A ? "child" : "parent" : r == Uml::A ? "client" : "supplier"); - QString roleIdStr = element.attribute(fetch, ""); + TQString roleIdStr = element.attribute(fetch, ""); if (roleIdStr.isEmpty()) { // Might be given as a child node instead - see below. continue; @@ -225,23 +225,23 @@ bool UMLAssociation::load( QDomElement & element ) { } } if (obj[A] == NULL || obj[B] == NULL) { - for (QDomNode node = element.firstChild(); !node.isNull(); + for (TQDomNode node = element.firstChild(); !node.isNull(); node = node.nextSibling()) { if (node.isComment()) continue; - QDomElement tempElement = node.toElement(); - QString tag = tempElement.tagName(); + TQDomElement tempElement = node.toElement(); + TQString tag = tempElement.tagName(); if (Model_Utils::isCommonXMIAttribute(tag)) continue; // Permitted tag names: // roleA: "child" "subtype" "client" // roleB: "parent" "supertype" "supplier" - QString idStr = tempElement.attribute( "xmi.id", "" ); + TQString idStr = tempElement.attribute( "xmi.id", "" ); if (idStr.isEmpty()) idStr = tempElement.attribute( "xmi.idref", "" ); if (idStr.isEmpty()) { - QDomNode inner = node.firstChild(); - QDomElement tmpElem = inner.toElement(); + TQDomNode inner = node.firstChild(); + TQDomElement tmpElem = inner.toElement(); idStr = tmpElem.attribute( "xmi.id", "" ); if (idStr.isEmpty()) idStr = tmpElem.attribute( "xmi.idref", "" ); @@ -271,13 +271,13 @@ bool UMLAssociation::load( QDomElement & element ) { return true; } - for (QDomNode node = element.firstChild(); !node.isNull(); + for (TQDomNode node = element.firstChild(); !node.isNull(); node = node.nextSibling()) { // uml13.dtd compliant format (new style) if (node.isComment()) continue; - QDomElement tempElement = node.toElement(); - QString tag = tempElement.tagName(); + TQDomElement tempElement = node.toElement(); + TQString tag = tempElement.tagName(); if (Model_Utils::isCommonXMIAttribute(tag)) continue; if (!tagEq(tag, "Association.connection") && @@ -352,11 +352,11 @@ bool UMLAssociation::load( QDomElement & element ) { } // From here on it's old-style stuff. - QString assocTypeStr = element.attribute( "assoctype", "-1" ); + TQString assocTypeStr = element.attribute( "assoctype", "-1" ); Uml::Association_Type assocType = Uml::at_Unknown; if (assocTypeStr[0] >= 'a' && assocTypeStr[0] <= 'z') { // In an earlier version, the natural assoctype names were saved. - const QString assocTypeString[nAssocTypes] = { + const TQString assocTypeString[nAssocTypes] = { "generalization", // at_Generalization "aggregation", // at_Aggregation "dependency", // at_Dependency @@ -426,16 +426,16 @@ bool UMLAssociation::load( QDomElement & element ) { setRoleDoc(element.attribute( "docb", "" ), B); // Visibility defaults to Public if it cant set it here.. - QString visibilityA = element.attribute( "visibilitya", "0"); - QString visibilityB = element.attribute( "visibilityb", "0"); + TQString visibilityA = element.attribute( "visibilitya", "0"); + TQString visibilityB = element.attribute( "visibilityb", "0"); if (visibilityA.toInt() > 0) setVisibility((Uml::Visibility::Value)visibilityA.toInt(), A); if (visibilityB.toInt() > 0) setVisibility((Uml::Visibility::Value)visibilityB.toInt(), B); // Changeability defaults to Changeable if it cant set it here.. - QString changeabilityA = element.attribute( "changeabilitya", "0"); - QString changeabilityB = element.attribute( "changeabilityb", "0"); + TQString changeabilityA = element.attribute( "changeabilitya", "0"); + TQString changeabilityB = element.attribute( "changeabilityb", "0"); if (changeabilityA.toInt() > 0) setChangeability ( (Uml::Changeability_Type) changeabilityA.toInt(), A); if (changeabilityB.toInt() > 0) @@ -452,7 +452,7 @@ Uml::IDType UMLAssociation::getObjectId(Uml::Role_Type role) { UMLRole *roleObj = m_pRole[role]; UMLObject *o = roleObj->getObject(); if (o == NULL) { - QString auxID = roleObj->getSecondaryId(); + TQString auxID = roleObj->getSecondaryId(); if (auxID.isEmpty()) { kError() << "UMLAssociation::getObjectId(" << role << "): getObject returns NULL" << endl; @@ -480,15 +480,15 @@ Uml::Visibility UMLAssociation::getVisibility(Uml::Role_Type role) const { return m_pRole[role]->getVisibility(); } -QString UMLAssociation::getMulti(Uml::Role_Type role) const { +TQString UMLAssociation::getMulti(Uml::Role_Type role) const { return m_pRole[role]->getMultiplicity(); } -QString UMLAssociation::getRoleName(Uml::Role_Type role) const { +TQString UMLAssociation::getRoleName(Uml::Role_Type role) const { return m_pRole[role]->getName(); } -QString UMLAssociation::getRoleDoc(Uml::Role_Type role) const { +TQString UMLAssociation::getRoleDoc(Uml::Role_Type role) const { return m_pRole[role]->getDoc(); } @@ -531,19 +531,19 @@ void UMLAssociation::setChangeability(Uml::Changeability_Type value, Uml::Role_T m_pRole[role]->setChangeability(value); } -void UMLAssociation::setMulti(const QString &value, Uml::Role_Type role) { +void UMLAssociation::setMulti(const TQString &value, Uml::Role_Type role) { m_pRole[role]->setMultiplicity(value); } -void UMLAssociation::setRoleName(const QString &value, Uml::Role_Type role) { +void UMLAssociation::setRoleName(const TQString &value, Uml::Role_Type role) { m_pRole[role]->setName(value); } -void UMLAssociation::setRoleDoc(const QString &doc, Uml::Role_Type role) { +void UMLAssociation::setRoleDoc(const TQString &doc, Uml::Role_Type role) { m_pRole[role]->setDoc(doc); } -QString UMLAssociation::ChangeabilityToString(Uml::Changeability_Type type) { +TQString UMLAssociation::ChangeabilityToString(Uml::Changeability_Type type) { switch (type) { case Uml::chg_Frozen: return "frozen"; |