Danny Shevitz | 17 Jul 18:49

problem with undo on delegated lists

howdy,

Another problem with delegation here. I believe it's a bug, but I always do 
and I'm usually wrong :-).

If a list is delegated as in

class A
 sub_nodes = List

class B
 a = Instance(A)
 sub_nodes = Delegate('a', modify=True)

Now imagine two instances of B share the same a

a = A()
b1 = B(a=a)
b2 = B(a=a)

so the b's are different but b1.a = b2.a = a.

Now the problem. If I change "a" (via "b", in a gui so we have an undo history),
then the undo history is appended with an undo item containing two changes, one
for b1 and one for b2. In fact there was only one change to the delegatee, "a".

If I do an undo/redo operation on the tree (via the default buttons) then
changes are made to both b1 and b2 resulting in twice as many changes to a.
So if I append to b1 and do an undo/redo I now end with two children under
both b1 and b2, when I should only have one.
(Continue reading)

Danny Shevitz | 21 Jul 17:07

Re: problem with undo on delegated lists

Dave, 

I'm not sure if you are working in ticket only mode now or not. This post seemed
to fall through the cracks so I copied it over as a ticket.

D

Gmane