13
0

Remove -x from ardbg, fix bug in memento command factory

git-svn-id: svn://localhost/ardour2/branches/undo@814 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Hans Fugal 2006-08-12 23:19:56 +00:00
parent e0d1b7cb4b
commit 92ab112480
2 changed files with 16 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh -x #!/bin/sh
dir=`dirname "$0"` dir=`dirname "$0"`
source $dir/ardev_common.sh source $dir/ardev_common.sh
exec gdb $dir/ardour.bin $* exec gdb $dir/ardour.bin $*

View File

@ -24,6 +24,7 @@ Command *Session::memento_command_factory(XMLNode *n)
{ {
PBD::ID id; PBD::ID id;
XMLNode *before = 0, *after = 0; XMLNode *before = 0, *after = 0;
XMLNode *child;
/* get id */ /* get id */
id = PBD::ID(n->property("obj_id")->value()); id = PBD::ID(n->property("obj_id")->value());
@ -33,10 +34,23 @@ Command *Session::memento_command_factory(XMLNode *n)
{ {
before = new XMLNode(*n->children().front()); before = new XMLNode(*n->children().front());
after = new XMLNode(*n->children().back()); after = new XMLNode(*n->children().back());
child = before;
} else if (n->name() == "MementoUndoCommand") } else if (n->name() == "MementoUndoCommand")
{
before = new XMLNode(*n->children().front()); before = new XMLNode(*n->children().front());
child = before;
}
else if (n->name() == "MementoRedoCommand") else if (n->name() == "MementoRedoCommand")
{
after = new XMLNode(*n->children().front()); after = new XMLNode(*n->children().front());
child = after;
}
if (!child)
{
error << _("Tried to reconstitute a MementoCommand with no contents, failing. id=") << id.to_s() << endmsg;
return 0;
}
/* create command */ /* create command */
@ -59,7 +73,7 @@ Command *Session::memento_command_factory(XMLNode *n)
return new MementoCommand<TempoMap>(*_tempo_map, before, after); return new MementoCommand<TempoMap>(*_tempo_map, before, after);
else if (obj_T == "Playlist" || obj_T == "AudioPlaylist") else if (obj_T == "Playlist" || obj_T == "AudioPlaylist")
{ {
if (Playlist *pl = playlist_by_name(before->property("name")->value())) if (Playlist *pl = playlist_by_name(child->property("name")->value()))
return new MementoCommand<Playlist>(*pl, before, after); return new MementoCommand<Playlist>(*pl, before, after);
} }
else if (obj_T == "Route") // inlcudes AudioTrack else if (obj_T == "Route") // inlcudes AudioTrack