[Uml-devel] Correction for patch

Achim Spangler Achim.Spangler at mnet-online.de
Wed Mar 17 05:02:00 UTC 2004


Hi,
I was too early with my assumption to have fixed the problem.
I detected too late, that the UseCase and Actor listitem entries are now 
inserted at wanted folder. But I missed due to my big project, that there is 
a double item outside the wanted folder.

Now I detected the reason:
Each Actor and UseCase entry is registered with UMLListViewItem instance 
_before_ the corresponding UMLListView::loadChildrenFromXMI() is called.

After some debug messages, I detected that the central UMLListView instance 
gets the following slot connection in 
UMLListView::connectNewObjectsSlots(UMLObject* object)
with the line:
connect(object,SIGNAL(modified()),this,SLOT(slotObjectChanged()));

This slot connection triggers the call of UMLListView::slotObjectChanged() 
which derives from the initiating object a pointer to a UMLListViewItem 
instance. For the returned pointer, the function 
UMLListViewItem::updateObject() is called.

I detected after the insertion of some debug messages in 
UMLListViewItem::updateObject(), that UMLListViewItem::updateObject() is 
called for each Actor and UseCase of my project _before_  the item would by 
created by UMLListView::loadChildrenFromXMI().

My solution:
Check in UMLListView::loadChildrenFromXMI() if there exists already a 
UMLListViewItem instance with same UID. If such an item is found, delete it, 
as the _main_ function to create the instance during load is 
UMLListView::loadChildrenFromXMI().

I attach the corresponding diff against the currenct CVS with final working 
changes.

I hope the maintainers of the corresponding parts can follow my descriptions, 
so that they can accept or correct my suggestions.

By the way:
Maybe the approach to delete UMLListViewItem instances for items which are 
loaded at the moment could be also suitable for the other UML types.

Bye,
Achim
Am Dienstag 16 März 2004 16:32 schrieb Achim Spangler:
> Hi,
> as I can create Use-Case and Actor entries as part of a folder, I'd like to
> load them into that folder again.
> But this is not possible at the moment.
>
> Reason:
> UMLListView::loadChildrenFromXMI( UMLListViewItem * parent, QDomElement &
> element )
> handles these UML types equivalent to class, enum, ... which can be only
> nested in packages.
>
> Possible solution:
> Change UMLListView::loadChildrenFromXMI( UMLListViewItem * parent,
> QDomElement & element )
> + Deactivate special handling - simply comment out corresponding
> case-labels + Use default switch-case handling
>
> Change UMLListViewItem::UMLListViewItem(UMLListViewItem * parent, QString
> name, Uml::ListView_Type t,int id)
> + Set pixmap correct for diagrams, use case and actors
>
> I performed these steps, and attached the diff ( diff -u -d -r1 ) relative
> to umbrello subdirectory of kdesdk.
>
> Please integrate or make a better solution.
>
> Bye,
> Achim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NestedUseCaseActor.diff.gz
Type: application/x-gzip
Size: 699 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/umbrello-devel/attachments/20040317/7ece2b12/attachment.gz>


More information about the umbrello-devel mailing list