[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Tue Dec 14 11:46:02 UTC 2004


CVS commit by okellogg: 

syncToModel(): Rename from mergeUMLRepresentationIntoAssociationData().


  M +13 -36    associationwidget.cpp   1.137
  M +2 -2      associationwidget.h   1.58


--- kdesdk/umbrello/umbrello/associationwidget.cpp  #1.136:1.137
@@ -295,4 +295,5 @@ void AssociationWidget::setName(const QS
                 m_pName = new FloatingText(m_pView, CalculateNameType(tr_Name), strName);
                 m_pName->setLink(this);
+                if (m_role[B].m_pWidget)
                 m_pName->setUMLObject(m_role[B].m_pWidget->getUMLObject());
         } else {
@@ -783,6 +784,5 @@ void AssociationWidget::setUMLAssociatio
 
                 assoc->nrof_parent_widgets++;
-                connect(assoc, SIGNAL(modified()), this,
-                                        SLOT(mergeUMLRepresentationIntoAssociationData()));
+                connect(assoc, SIGNAL(modified()), this, SLOT(syncToModel()));
         }
 
@@ -1119,11 +1119,9 @@ void AssociationWidget::setActivated(boo
 }
 
-// CHECK: Can we get rid of this
-void AssociationWidget::mergeUMLRepresentationIntoAssociationData()
+void AssociationWidget::syncToModel()
 {
         UMLAssociation *uml = getAssociation();
 
         if (uml == NULL) {
-                kdDebug() << "The UMLAssociation* uml is null -- returning from the function to avoid crashing."  << endl;
                 return;
         }
@@ -1131,33 +1129,13 @@ void AssociationWidget::mergeUMLRepresen
         uml->blockSignals(true);
 
-        // floating text widgets
-        FloatingText *text = getNameWidget();
-        if (text)
-                text->setText(uml->getName());
-
-        text = getRoleWidget(A);
-        if (text)
-        {
-                text->setText(uml->getRoleName(A));
-                // it doesnt make sense to have visibility wi/o Rolename
-                // so we only set it when its in here. Probably should have
-                // error condition thrown when visb is set but rolename isnt.
+        setName(uml->getName());
+        setRoleName(uml->getRoleName(A), A);
+        setRoleName(uml->getRoleName(B), B);
                 setVisibility(uml->getVisibility(A), A);
-        }
-
-        text = getRoleWidget(B);
-        if (text)
-        {
-                text->setText(uml->getRoleName(B));
                 setVisibility(uml->getVisibility(B), B);
-        }
-
-        text = getMultiWidget(A);
-        if (text)
-                text->setText(uml->getMulti(A));
-
-        text = getMultiWidget(B);
-        if (text)
-                text->setText(uml->getMulti(B));
+        setChangeability(uml->getChangeability(A), A);
+        setChangeability(uml->getChangeability(B), B);
+        setMulti(uml->getMulti(A), A);
+        setMulti(uml->getMulti(B), B);
 
         uml->blockSignals(false);

--- kdesdk/umbrello/umbrello/associationwidget.h  #1.57:1.58
@@ -870,7 +870,7 @@ public slots:
 
         /**
-         * Merge together the UMLAssociation representation and this widget
+         * Synchronize this widget from the UMLAssociation.
          */
-        void mergeUMLRepresentationIntoAssociationData();
+        void syncToModel();
 };
 #endif






More information about the umbrello-devel mailing list