[Uml-devel] kdesdk/umbrello/umbrello

Brian Thomas thomas at mail630.gsfc.nasa.gov
Fri Sep 12 11:55:58 UTC 2003


CVS commit by thomas: 

bug fix: interfaces dont need add/removeAttribute connections. Use attribute m_isInterface to cache what type of classifier this is


  M +8 -4      classifiercodedocument.cpp   1.9
  M +1 -0      classifiercodedocument.h   1.5


--- kdesdk/umbrello/umbrello/classifiercodedocument.h  #1.4:1.5
@@ -210,4 +210,5 @@ private:
         QPtrList<CodeClassField> m_classfieldVector;
         UMLClassifier * m_parentclassifier;
+        bool m_isInterface;
 
         // using the passed list, update our inventory of CodeClassFields which are

--- kdesdk/umbrello/umbrello/classifiercodedocument.cpp  #1.8:1.9
@@ -291,6 +291,5 @@ void ClassifierCodeDocument::addCodeClas
 
 bool ClassifierCodeDocument::parentIsInterface () {
-        UMLClassifier * c = getParentClassifier();
-        return dynamic_cast<UMLInterface*>(c) ? true : false; 
+        return m_isInterface;
 }
 
@@ -324,4 +323,5 @@ void ClassifierCodeDocument::init (UMLCl
 
         m_parentclassifier = c;
+        m_isInterface = dynamic_cast<UMLInterface*>(c) ? true : false; 
         m_classfieldVector.setAutoDelete(true);
         m_classFieldMap = new QMap<UMLObject *, CodeClassField*>;
@@ -332,6 +332,10 @@ void ClassifierCodeDocument::init (UMLCl
 
         // slots
+        if(!parentIsInterface())
+        {
         connect(c,SIGNAL(attributeAdded(UMLObject*)),this,SLOT(addAttributeClassField(UMLObject*)));
         connect(c,SIGNAL(attributeRemoved(UMLObject*)),this,SLOT(removeAttributeClassField(UMLObject*)));
+        }
+
         connect(c,SIGNAL(sigAssociationAdded(UMLAssociation*)),this,SLOT(addAssociationClassField(UMLAssociation*)));
         connect(c,SIGNAL(sigAssociationRemoved(UMLAssociation*)),this,SLOT(removeAssociationClassField(UMLAssociation*)));






More information about the umbrello-devel mailing list