From 4675e82dae45a70ee27bf11d10aa6872485c8847 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 8 Oct 2007 02:57:21 +0000 Subject: Eliminate redundant object collections (ObjectModel having a separate collection of its children). Fix renaming/creation of children (fix ticket 97). git-svn-id: http://svn.drobilla.net/lad/ingen@844 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/PatchModel.cpp | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'src/libs/client/PatchModel.cpp') diff --git a/src/libs/client/PatchModel.cpp b/src/libs/client/PatchModel.cpp index 2bd514f3..3997ac77 100644 --- a/src/libs/client/PatchModel.cpp +++ b/src/libs/client/PatchModel.cpp @@ -32,7 +32,7 @@ PatchModel::add_child(SharedPtr c) { assert(c->parent().get() == this); - ObjectModel::add_child(c); + //ObjectModel::add_child(c); SharedPtr pm = PtrCast(c); if (pm) { @@ -45,12 +45,13 @@ PatchModel::add_child(SharedPtr c) signal_new_node.emit(nm); } +/* SharedPtr PatchModel::get_node(const string& name) const { return PtrCast(get_child(name)); } - +*/ bool PatchModel::remove_child(SharedPtr o) @@ -82,35 +83,21 @@ PatchModel::remove_child(SharedPtr o) j = next; } - if (ObjectModel::remove_child(o)) { - SharedPtr nm = PtrCast(o); - if (nm) { - signal_removed_node.emit(nm); - } - return true; - } else { - return false; - } + SharedPtr nm = PtrCast(o); + if (nm) + signal_removed_node.emit(nm); + + return true; } void PatchModel::clear() { - //for (list >::iterator j = _connections.begin(); j != _connections.end(); ++j) - // delete (*j); - - /*for (Children::iterator i = _children.begin(); i != _children.end(); ++i) { - (*i).second->clear(); - //delete (*i).second; - }*/ - - _children.clear(); _connections.clear(); NodeModel::clear(); - assert(_children.empty()); assert(_connections.empty()); assert(_ports.empty()); } -- cgit v1.2.1