-
Dmitry Kazakov authored
There are two changes: 1) See: http://community.kde.org/Krita/Undo_adapter_vs_Undo_store Split the functionality of KisUndoAdapter into two classes: KisUndoStore and KisUndoAdapter. The former one works as an interface to an external storage of the undo information: undo stack, KoDocument, /dev/null. The latter one defines the behavior of the system when someone wants to add a command. There are three variants: 1) KisSurrogateUndoAdapter -- saves commands directly to the internal stack. Used for wrapping around legacy code into a single command. 2) KisLegacyUndoAdapter -- blocks the strokes and updates queue, and then adds the command to a store 3) KisPostExecutionUndoAdapter -- used by the strokes. It doesn't call redo() when you add a command. It is assumed, that you have already executed the command yourself and now just notify the system about it. Warning: it doesn't inherit KisUndoAdapter because it doesn't fit the contract of this class. And, more important, KisTransaction should work differently with this class. 2) The ownership on the KisUndoStore (that substituted KisUndoAdapter in the document's code) now belongs to the image. It means that KisDoc2::createUndoStore() is just a factory method, the document doesn't store the undo store itself.
903079cc