Nested operations
-
I think I know the answer, and the answer is no, but I figured I'd check.
Can you nest start_operation, commit_operation calls? For example:model.start_operation "Operation A" #do something model.start_operation "Operation B" #do some more stuff model.commit_operation #ending operation B #do some final stuff model.commit_operation #ending operation A
I figure the answer is that it at least won't work the way I want. What I would expect is that the outermost start / commit (Operation A), would be the only one exposed in the Undo / Redo because it contains Operation B within it. But what I think I see is that both A and B show up in the menu. This seems bad, because it implies that some operations from A are either being attributed to B, or being handled outside all the operations entirely. Anyway, does anyone know a more official explanation? The API, as usual, says very little on the subject.
-
No, you cannot do nest commits. Assume the behavior is undefined.
-
Ok. thanks!
Advertisement