From c26215c1e59b6341da86f94f5b2b3ca950dd3889 Mon Sep 17 00:00:00 2001 From: Hans Fugal Date: Wed, 9 Aug 2006 14:15:05 +0000 Subject: 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 --- libs/pbd/undo.cc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'libs/pbd/undo.cc') 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 #include +#include using namespace std; using namespace sigc; @@ -86,7 +87,11 @@ UndoTransaction::redo () XMLNode &UndoTransaction::get_state() { XMLNode *node = new XMLNode ("UndoTransaction"); - // TODO + + list::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::iterator it; + for (it=UndoList.begin(); it != UndoList.end(); it++) + node->add_child_nocopy(it->get_state()); + + return *node; +} -- cgit v1.2.3