From 6f93b3d7c80f9dee2d95fac1bbc4f781a6f45979 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 18 Sep 2006 06:24:53 +0000 Subject: Work on loading old (deprecated) patches. More error tolerance in Store, related bugfixes. Patch port adding (threading) bug fixed (made event blocking). Better PatchView cacheing. Moved generic things from engine to util (shared) Bug fixes, features, etc. git-svn-id: http://svn.drobilla.net/lad/ingen@142 a436a847-0d15-0410-975c-d299462d15a1 --- src/progs/ingenuity/BreadCrumbBox.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/progs/ingenuity/BreadCrumbBox.cpp') diff --git a/src/progs/ingenuity/BreadCrumbBox.cpp b/src/progs/ingenuity/BreadCrumbBox.cpp index c4234e8a..5fa5eb6e 100644 --- a/src/progs/ingenuity/BreadCrumbBox.cpp +++ b/src/progs/ingenuity/BreadCrumbBox.cpp @@ -28,6 +28,17 @@ BreadCrumbBox::BreadCrumbBox() } +CountedPtr +BreadCrumbBox::view(const Path& path) +{ + for (std::list::const_iterator i = _breadcrumbs.begin(); i != _breadcrumbs.end(); ++i) + if ((*i)->path() == path) + return (*i)->view(); + + return CountedPtr(); +} + + /** Sets up the crumbs to display a @a path. * * If @a path is already part of the shown path, it will be selected and the @@ -45,7 +56,12 @@ BreadCrumbBox::build(Path path, CountedPtr view) for (std::list::iterator i = _breadcrumbs.begin(); i != _breadcrumbs.end(); ++i) { if ((*i)->path() == path) { (*i)->set_active(true); - (*i)->set_view(view); + if (!(*i)->view()) + (*i)->set_view(view); + + // views are expensive, having two around for the same patch is a bug + assert((*i)->view() == view); + } else { (*i)->set_active(false); } -- cgit v1.2.1