[Uml-devel] kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Fri Mar 25 15:03:38 UTC 2005
CVS commit by okellogg:
No need for m_pOperation. Using m_pObject for the collabration
message operation gives us propagation of renaming to the diagram.
M +19 -12 associationwidget.cpp 1.145
--- kdesdk/umbrello/umbrello/associationwidget.cpp #1.144:1.145
@@ -32,4 +32,5 @@
#include "classifier.h"
#include "attribute.h"
+#include "operation.h"
#include "association.h"
#include "assocrules.h"
@@ -420,5 +421,5 @@ void AssociationWidget::setMessageText(F
QString message;
if (getAssocType() == at_Coll_Message) {
- if (m_pOperation != NULL) {
+ if (m_pObject != NULL) {
message = getMulti(A) + ": " + getOperationText(m_pView);
} else {
@@ -2763,5 +2764,4 @@ void AssociationWidget::init (UMLView *v
m_umldoc = UMLApp::app()->getDocument();
m_LinePath.setAssociation( this );
- m_pOperation = NULL;
connect(m_pView, SIGNAL(sigRemovePopupMenu()), this, SLOT(slotRemovePopupMenu()));
@@ -2810,9 +2810,13 @@ int AssociationWidget::getTotalCount(Rol
UMLOperation *AssociationWidget::getOperation() {
- return m_pOperation;
+ return dynamic_cast<UMLOperation*>(m_pObject);
}
void AssociationWidget::setOperation(UMLOperation *op) {
- m_pOperation = op;
+ if (m_pObject)
+ disconnect(m_pObject, SIGNAL(modified()), m_pName, SLOT(setMessageText()));
+ m_pObject = op;
+ if (m_pObject)
+ connect(m_pObject, SIGNAL(modified()), m_pName, SLOT(setMessageText()));
}
@@ -3028,5 +3032,7 @@ bool AssociationWidget::loadFromXMI( QDo
<< ID2STR(nId) << endl;
return false;
- } else if (myObj->getBaseType() == ot_Attribute) {
+ } else {
+ const Uml::Object_Type ot = myObj->getBaseType();
+ if (ot == ot_Attribute || ot == ot_Operation) {
m_pObject = myObj;
QString type = qElement.attribute( "type", "-1" );
@@ -3039,4 +3045,5 @@ bool AssociationWidget::loadFromXMI( QDo
}
}
+ }
QString indexa = qElement.attribute( "indexa", "0" );
More information about the umbrello-devel
mailing list