diff options
author | Carl Hetherington <carl@carlh.net> | 2010-02-09 22:28:46 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-02-09 22:28:46 +0000 |
commit | 12b9571b8007238a365324238e42721ab994853f (patch) | |
tree | bfe504849d6d25ce74ea08f1c2bb34465b3c51a4 /libs/pbd/stateful_diff_command.cc | |
parent | cf9ce8636a95ffcebc1454f842250733edf41de6 (diff) |
Save and not-yet-working restore of StatefulDiffCommands.
git-svn-id: svn://localhost/ardour2/branches/3.0@6669 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/stateful_diff_command.cc')
-rw-r--r-- | libs/pbd/stateful_diff_command.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/libs/pbd/stateful_diff_command.cc b/libs/pbd/stateful_diff_command.cc index 788a5be034..1332cae4ff 100644 --- a/libs/pbd/stateful_diff_command.cc +++ b/libs/pbd/stateful_diff_command.cc @@ -18,6 +18,7 @@ */ #include "pbd/stateful_diff_command.h" +#include "i18n.h" using namespace std; using namespace PBD; @@ -35,6 +36,13 @@ StatefulDiffCommand::StatefulDiffCommand (Stateful* s) _after = p.second; } +StatefulDiffCommand::StatefulDiffCommand (Stateful* s, XMLNode const & n) + : _object (s) +{ + _before = new XMLNode (*n.children().front()); + _after = new XMLNode (*n.children().back()); +} + StatefulDiffCommand::~StatefulDiffCommand () { @@ -57,5 +65,12 @@ StatefulDiffCommand::undo () XMLNode& StatefulDiffCommand::get_state () { - /* XXX */ + XMLNode* node = new XMLNode (X_("StatefulDiffCommand")); + + node->add_property ("obj-id", _object->id().to_s()); + node->add_property ("type-name", typeid(*_object).name()); + node->add_child_copy (*_before); + node->add_child_copy (*_after); + + return *node; } |