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

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


SVN commit 509132 by okellogg:

setOperation(): Connect the operation's modified() to the m_pFText's setMessageText().
This is the basic precondition for operation renaming to be propgated from
the list view to the sequence diagram but I haven't been able to reproduce
the reported freezing.
CCBUG:121886


 M  +8 -2      messagewidget.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/messagewidget.cpp #509131:509132
@@ -484,7 +484,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() {
@@ -815,9 +819,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.
@@ -839,7 +844,6 @@
                 m_CustomOp = QString::null;
             }
         }
-        setOperation(op);
     }
 
     Uml::IDType textId = STR2ID(textid);
@@ -878,6 +882,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