diff options
author | David Robillard <d@drobilla.net> | 2007-10-08 02:57:21 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-10-08 02:57:21 +0000 |
commit | 4675e82dae45a70ee27bf11d10aa6872485c8847 (patch) | |
tree | 24210667e721d400a552ad2621e9a5cfe447395c /src/libs/client/PatchModel.cpp | |
parent | 9d9efa215c52a6b75eef7e9a8b088b11dfd76a07 (diff) | |
download | ingen-4675e82dae45a70ee27bf11d10aa6872485c8847.tar.gz ingen-4675e82dae45a70ee27bf11d10aa6872485c8847.tar.bz2 ingen-4675e82dae45a70ee27bf11d10aa6872485c8847.zip |
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
Diffstat (limited to 'src/libs/client/PatchModel.cpp')
-rw-r--r-- | src/libs/client/PatchModel.cpp | 29 |
1 files changed, 8 insertions, 21 deletions
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<ObjectModel> c) { assert(c->parent().get() == this); - ObjectModel::add_child(c); + //ObjectModel::add_child(c); SharedPtr<PortModel> pm = PtrCast<PortModel>(c); if (pm) { @@ -45,12 +45,13 @@ PatchModel::add_child(SharedPtr<ObjectModel> c) signal_new_node.emit(nm); } +/* SharedPtr<NodeModel> PatchModel::get_node(const string& name) const { return PtrCast<NodeModel>(get_child(name)); } - +*/ bool PatchModel::remove_child(SharedPtr<ObjectModel> o) @@ -82,35 +83,21 @@ PatchModel::remove_child(SharedPtr<ObjectModel> o) j = next; } - if (ObjectModel::remove_child(o)) { - SharedPtr<NodeModel> nm = PtrCast<NodeModel>(o); - if (nm) { - signal_removed_node.emit(nm); - } - return true; - } else { - return false; - } + SharedPtr<NodeModel> nm = PtrCast<NodeModel>(o); + if (nm) + signal_removed_node.emit(nm); + + return true; } void PatchModel::clear() { - //for (list<SharedPtr<ConnectionModel> >::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()); } |