[Uml-devel] [Bug 72016] crash when deleteing an attribute/operation etc
Oliver Kellogg
okellogg at users.sourceforge.net
Wed Jun 8 14:14:34 UTC 2005
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=72016
okellogg users sourceforge net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |FIXED
------- Additional Comments From okellogg users sourceforge net 2005-06-08 23:13 -------
SVN commit 423555 by okellogg:
setUMLObject(), slotAttributeRemoved(): New.
Cater to proper suicide if the underlying UMLAttribute is removed.
BUG:72016
M +13 -0 associationwidget.cpp
M +15 -0 associationwidget.h
--- trunk/KDE/kdesdk/umbrello/umbrello/associationwidget.cpp #423554:423555
@ -2987,7 +2987,20 @
return rectangle;
}
+void AssociationWidget::setUMLObject(UMLObject *obj) {
+ WidgetBase::setUMLObject(obj);
+ if (obj && obj->getBaseType() == Uml::ot_Attribute) {
+ UMLClassifier *klass = static_cast<UMLClassifier*>(obj->parent());
+ connect(klass, SIGNAL(attributeRemoved(UMLObject*)),
+ this, SLOT(slotAttributeRemoved(UMLObject*)));
+ }
+}
+void AssociationWidget::slotAttributeRemoved(UMLObject* obj) {
+ kdDebug() << "AssociationWidget::slotAttributeRemoved(" << obj->getName() << ")" << endl;
+ m_pView->removeAssoc(this);
+}
+
void AssociationWidget::init (UMLView *view)
{
m_pView = view; // pointer to parent viewwidget object
--- trunk/KDE/kdesdk/umbrello/umbrello/associationwidget.h #423554:423555
@ -560,6 +560,13 @
void computeAssocClassLine();
/**
+ * Overriding the method from WidgetBase because we need to do
+ * something extra in case this AssociationWidget represents
+ * an attribute of a classifier.
+ */
+ void setUMLObject(UMLObject *obj);
+
+ /**
* Saves this widget to the <assocwidget> XMI element.
*/
void saveToXMI( QDomDocument & qDoc, QDomElement & qElement );
@ -924,6 +931,14 @
void slotClearAllSelected();
/**
+ * Connected to UMLClassifier::attributeRemoved() in case this
+ * AssociationWidget is linked to a classifer's attribute type.
+ *
+ * param obj The UMLAttribute removed.
+ */
+ void slotAttributeRemoved(UMLObject* obj);
+
+ /**
* Synchronize this widget from the UMLAssociation.
*/
void syncToModel();
More information about the umbrello-devel
mailing list