[Uml-devel] kdesdk/umbrello/umbrello

Brian Thomas thomas at mail630.gsfc.nasa.gov
Thu Sep 11 09:22:15 UTC 2003


CVS commit by thomas: 

This new attribute "Id" isnt good..there is already an "ID" attribute
from the parent umlobject class.. IF you really want the ID to be slaved
to the parent UMLObject of the role, we should overload the getID method 
(and NOT allow a setID) rather than spawn a new Id attribute. Also, I cant 
find anything that needs this method, so I've commented it out.


  M +14 -8     umlrole.cpp   1.5


--- kdesdk/umbrello/umbrello/umlrole.cpp  #1.4:1.5
@@ -15,9 +15,5 @@ UMLRole::UMLRole(UMLAssociation * parent
     : UMLObject((UMLObject *)parent)
 {
-        init();
-
-        // connect this up to parent
-        connect(this,SIGNAL(modified()),parent,SIGNAL(modified()));
-
+        init(parent);
 }
 
@@ -27,5 +23,4 @@ bool UMLRole::operator==(UMLRole &rhs) {
         }
         return( UMLObject::operator==( rhs ) &&
-                m_Id == rhs.m_Id &&
                 m_Changeability == rhs.m_Changeability &&
                 m_Visibility == rhs.m_Visibility &&
@@ -44,4 +39,9 @@ UMLObject* UMLRole::getObject() {
 }
 
+/*
+ // This isnt good..there is already a getID for the parent
+ // umlobject class.. should overload that method rather than
+ // spawn a new Id attribute. Also, I cant find anything that
+ // needs this method, so I've commented it out. -b.t.
 int UMLRole::getId() const {
         if(m_pObject)
@@ -49,4 +49,5 @@ int UMLRole::getId() const {
         return m_Id;
 }
+*/
 
 Changeability_Type UMLRole::getChangeability() const {
@@ -70,4 +71,5 @@ QString UMLRole::getDoc() const {
 }
 
+/*
 void UMLRole::setId(int id) {
         m_Id = id;
@@ -76,4 +78,5 @@ void UMLRole::setId(int id) {
         emit modified();
 }
+*/
 
 void UMLRole::setObject (UMLObject *obj) {
@@ -113,11 +116,14 @@ void UMLRole::setDoc(QString doc) {
 }
 
-void UMLRole::init() {
+void UMLRole::init(UMLAssociation * parent) {
+
         m_pObject = 0;
-        m_Id = -1;
         m_Multi = "";
         m_Name = "";
         m_Visibility = Public;
         m_Changeability = chg_Changeable;
+
+        // connect this up to parent 
+        connect(this,SIGNAL(modified()),parent,SIGNAL(modified()));
 }
 






More information about the umbrello-devel mailing list