[Uml-devel] KDE/kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Mon Feb 13 11:29:00 UTC 2006


SVN commit 509135 by okellogg:

apply commit 509132 from branches/KDE/3.5

 M  +8 -2      messagewidget.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/messagewidget.cpp #509134:509135
@@ -489,7 +489,11 @@
 }
 
 void MessageWidget::setOperation(UMLOperation *op) {
+    if (m_pObject && m_pFText)
+        disconnect(m_pObject, SIGNAL(modified()), m_pFText, SLOT(setMessageText()));
     m_pObject = op;
+    if (m_pObject && m_pFText)
+        connect(m_pObject, SIGNAL(modified()), m_pFText, SLOT(setMessageText()));
 }
 
 QString MessageWidget::getCustomOpText() {
@@ -820,9 +824,10 @@
     updateResizability();
 
     UMLClassifier *c = dynamic_cast<UMLClassifier*>( pWB->getUMLObject() );
+    UMLOperation *op = NULL;
     if (c) {
         Uml::IDType opId = STR2ID(m_CustomOp);
-        UMLOperation *op = dynamic_cast<UMLOperation*>( c->findChildObjectById(opId, true) );
+        op = dynamic_cast<UMLOperation*>( c->findChildObjectById(opId, true) );
         if (op) {
             // If the UMLOperation is set, m_CustomOp isn't used anyway.
             // Just setting it empty for the sake of sanity.
@@ -844,7 +849,6 @@
                 m_CustomOp = QString::null;
             }
         }
-        setOperation(op);
     }
 
     Uml::IDType textId = STR2ID(textid);
@@ -883,6 +887,8 @@
             << tag << endl;
         }
     }
+    if (op)                // Do it here and not earlier because now we have the
+        setOperation(op);  // m_pFText and setOperation() can make connections.
 
     // always need this
     setLinkAndTextPos();




More information about the umbrello-devel mailing list