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/Store.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/Store.cpp')
-rw-r--r-- | src/libs/client/Store.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp index af6b33c5..e1744ac0 100644 --- a/src/libs/client/Store.cpp +++ b/src/libs/client/Store.cpp @@ -400,7 +400,7 @@ Store::new_plugin_event(const string& uri, const string& type_uri, const string& void Store::new_patch_event(const Path& path, uint32_t poly) { - SharedPtr<PatchModel> p(new PatchModel(path, poly)); + SharedPtr<PatchModel> p(new PatchModel(*this, path, poly)); add_object(p); } @@ -412,10 +412,10 @@ Store::new_node_event(const string& plugin_uri, const Path& node_path, bool is_p SharedPtr<PluginModel> plug = plugin(plugin_uri); if (!plug) { - SharedPtr<NodeModel> n(new NodeModel(plugin_uri, node_path, is_polyphonic)); + SharedPtr<NodeModel> n(new NodeModel(*this, plugin_uri, node_path, is_polyphonic)); add_plugin_orphan(n); } else { - SharedPtr<NodeModel> n(new NodeModel(plug, node_path, is_polyphonic)); + SharedPtr<NodeModel> n(new NodeModel(*this, plug, node_path, is_polyphonic)); add_object(n); } } @@ -426,7 +426,7 @@ Store::new_port_event(const Path& path, const string& type, bool is_output) { PortModel::Direction pdir = is_output ? PortModel::OUTPUT : PortModel::INPUT; - SharedPtr<PortModel> p(new PortModel(path, type, pdir)); + SharedPtr<PortModel> p(new PortModel(*this, path, type, pdir)); add_object(p); if (p->parent()) resolve_connection_orphans(p); @@ -473,12 +473,9 @@ void Store::patch_cleared_event(const Path& path) { SharedPtr<PatchModel> patch = PtrCast<PatchModel>(object(path)); - if (patch) { - ObjectModel::Children children = patch->children(); // take a copy - for (ObjectModel::Children::iterator i = children.begin(); i != children.end(); ++i) { + if (patch) + for (ObjectModel::const_iterator i = patch->children_begin(); i != patch->children_end(); ++i) destruction_event(i->second->path()); - } - } } |