summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-08-14 14:36:51 +0000
committerDavid Robillard <d@drobilla.net>2012-08-14 14:36:51 +0000
commita8312be2d849b73ff0acc80a226095bcfee3556c (patch)
treebb5d7de6c3fd8b5ac121ec023e46a90ddc24abb0 /src/gui
parent50f85edbd0f07135eb73201367bbd256792ee999 (diff)
downloadingen-a8312be2d849b73ff0acc80a226095bcfee3556c.tar.gz
ingen-a8312be2d849b73ff0acc80a226095bcfee3556c.tar.bz2
ingen-a8312be2d849b73ff0acc80a226095bcfee3556c.zip
Saner/faster Store interface for finding children.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4694 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/LoadPluginWindow.cpp3
-rw-r--r--src/gui/PatchCanvas.cpp5
2 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp
index b7e118bd..f87eba25 100644
--- a/src/gui/LoadPluginWindow.cpp
+++ b/src/gui/LoadPluginWindow.cpp
@@ -135,7 +135,8 @@ LoadPluginWindow::name_changed()
const string sym = _node_name_entry->get_text();
if (!Symbol::is_valid(sym)) {
_add_button->property_sensitive() = false;
- } else if (_app->store()->find_child(_patch, Symbol(sym))) {
+ } else if (_app->store()->find(_patch->path().child(Symbol(sym)))
+ != _app->store()->end()) {
_add_button->property_sensitive() = false;
} else {
_add_button->property_sensitive() = true;
diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp
index 936fb259..6061eeb2 100644
--- a/src/gui/PatchCanvas.cpp
+++ b/src/gui/PatchCanvas.cpp
@@ -290,9 +290,10 @@ PatchCanvas::build_plugin_menu()
void
PatchCanvas::build()
{
+ const Store::const_range kids = _app.store()->children_range(_patch);
+
// Create modules for nodes
- for (Store::const_iterator i = _app.store()->children_begin(_patch);
- i != _app.store()->children_end(_patch); ++i) {
+ for (Store::const_iterator i = kids.first; i != kids.second; ++i) {
SharedPtr<NodeModel> node = PtrCast<NodeModel>(i->second);
if (node && node->parent() == _patch)
add_node(node);