diff options
author | Hans Fugal <hans@fugal.net> | 2006-08-09 14:15:05 +0000 |
---|---|---|
committer | Hans Fugal <hans@fugal.net> | 2006-08-09 14:15:05 +0000 |
commit | c26215c1e59b6341da86f94f5b2b3ca950dd3889 (patch) | |
tree | aded41982da1aae24d553407595a3dc7482c3ac7 /libs/pbd/undo.cc | |
parent | 5fc16bf95f43c816cbabbc594f826d1d934adbd4 (diff) |
r283@gandalf: fugalh | 2006-08-09 08:13:37 -0600
Save state basics, including adding PBD::ID to the delinquents. Compiles but needs to be tested (because I can't get the whole thing to compile on OSX due to the Rect problem).
git-svn-id: svn://localhost/ardour2/branches/undo@769 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/undo.cc')
-rw-r--r-- | libs/pbd/undo.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/libs/pbd/undo.cc b/libs/pbd/undo.cc index a5ca6b713a..8d1b416c16 100644 --- a/libs/pbd/undo.cc +++ b/libs/pbd/undo.cc @@ -22,6 +22,7 @@ #include <pbd/undo.h> #include <pbd/xml++.h> +#include <string> using namespace std; using namespace sigc; @@ -86,7 +87,11 @@ UndoTransaction::redo () XMLNode &UndoTransaction::get_state() { XMLNode *node = new XMLNode ("UndoTransaction"); - // TODO + + list<Command*>::iterator it; + for (it=actions.begin(); it!=actions.end(); it++) + node->add_child_nocopy((*it)->get_state()); + return *node; } @@ -142,3 +147,14 @@ UndoHistory::clear () RedoList.clear (); UndoList.clear (); } + +XMLNode & UndoHistory::get_state() +{ + XMLNode *node = new XMLNode ("UndoHistory"); + + list<UndoTransaction>::iterator it; + for (it=UndoList.begin(); it != UndoList.end(); it++) + node->add_child_nocopy(it->get_state()); + + return *node; +} |