[Potlatch-dev] Introducing Magic Roundabout tool
Steve Bennett
stevagewp at gmail.com
Sat Feb 26 02:08:37 GMT 2011
On Sat, Feb 26, 2011 at 12:43 AM, Andy Allan <gravitystorm at gmail.com> wrote:
> This is where I could be wrong, but I think that it's critical to the
> redo part. When undo'ing an action the action is added to the redo
> list, so if adding an action has side-effects that'll blow up during
> redoing the action. Also, if the action works based on side effects
> that aren't tracked within the action itself, then it won't work
> properly when being redone.
Ok, I obviously wasn't explaining myself well, so I'll let some code
do the talking:
http://trac.openstreetmap.org/changeset/25431
This solves my problem: actions are carried out immediately, and then
added to the MainUndoStack later. It's not that the actions had "side
effects", I just needed access to the "main effect" immediately. The
difference is from this:
Create action A
Create action B
Create action C
Add to main undo stack
- do action A
- do action B
- do action C
To this:
Create action A
- do action A
Create action B
- do action B
Create action C
- do cation C
Add to main undo stack
- (already done).
I might be overlooking something, of course. I still get a couple of
spurious entries in the undo list which I haven't really investigated
yet. And there were some weird fake duplicate nodes being shown, which
might be a symptom of node state not being managed properly.
Steve
More information about the Potlatch-dev
mailing list