diff options
author | Carl Hetherington <carl@carlh.net> | 2010-04-01 01:07:24 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-04-01 01:07:24 +0000 |
commit | 50dd880d7e75b49e7c80c79f32165a756839651c (patch) | |
tree | e4908863b98570709844a2ce536a44ee34479ac7 /libs/pbd/stateful_diff_command.cc | |
parent | afc5e3bd0251dbcdbde27036569eb1acab026991 (diff) |
No-op: rename a few variables and add/fix some comments.
git-svn-id: svn://localhost/ardour2/branches/3.0@6818 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/stateful_diff_command.cc')
-rw-r--r-- | libs/pbd/stateful_diff_command.cc | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/libs/pbd/stateful_diff_command.cc b/libs/pbd/stateful_diff_command.cc index bfd9f33440..0468ac3e8a 100644 --- a/libs/pbd/stateful_diff_command.cc +++ b/libs/pbd/stateful_diff_command.cc @@ -34,35 +34,35 @@ using namespace PBD; StatefulDiffCommand::StatefulDiffCommand (boost::shared_ptr<Stateful> s) : _object (s) - , _before (new PropertyList) - , _after (new PropertyList) + , _undo (new PropertyList) + , _redo (new PropertyList) { - s->diff (*_before, *_after); + s->diff (*_undo, *_redo); } StatefulDiffCommand::StatefulDiffCommand (boost::shared_ptr<Stateful> s, XMLNode const & n) : _object (s) - , _before (0) - , _after (0) + , _undo (0) + , _redo (0) { const XMLNodeList& children (n.children()); for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) { if ((*i)->name() == X_("Undo")) { - _before = s->property_factory (**i); + _undo = s->property_factory (**i); } else if ((*i)->name() == X_("Do")) { - _after = s->property_factory (**i); + _redo = s->property_factory (**i); } } - assert (_before != 0); - assert (_after != 0); + assert (_undo != 0); + assert (_redo != 0); } StatefulDiffCommand::~StatefulDiffCommand () { - delete _before; - delete _after; + delete _undo; + delete _redo; } void @@ -71,7 +71,7 @@ StatefulDiffCommand::operator() () boost::shared_ptr<Stateful> s (_object.lock()); if (s) { - PropertyChange changed = s->set_properties (*_after); + PropertyChange changed = s->set_properties (*_redo); if (!changed.empty()) { s->PropertyChanged (changed); } @@ -85,7 +85,7 @@ StatefulDiffCommand::undo () if (s) { std::cerr << "Undoing a stateful diff command\n"; - PropertyChange changed = s->set_properties (*_before); + PropertyChange changed = s->set_properties (*_undo); if (!changed.empty()) { std::cerr << "Sending changed\n"; s->PropertyChanged (changed); @@ -108,14 +108,14 @@ StatefulDiffCommand::get_state () node->add_property ("obj-id", s->id().to_s()); node->add_property ("type-name", demangled_name (*s.get())); - XMLNode* before = new XMLNode (X_("Undo")); - XMLNode* after = new XMLNode (X_("Do")); + XMLNode* undo = new XMLNode (X_("Undo")); + XMLNode* redo = new XMLNode (X_("Do")); - _before->add_history_state (before); - _after->add_history_state (after); + _undo->add_history_state (undo); + _redo->add_history_state (redo); - node->add_child_nocopy (*before); - node->add_child_nocopy (*after); + node->add_child_nocopy (*undo); + node->add_child_nocopy (*redo); return *node; } |