From 1e0424662ba99a9d73f05d818341942c6df23c09 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 15 Sep 2008 04:25:14 +0000 Subject: Fix connecting when human names are visible. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1503 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/gui/PatchCanvas.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/libs/gui/PatchCanvas.cpp b/src/libs/gui/PatchCanvas.cpp index 2aba1ec0..da4b2374 100644 --- a/src/libs/gui/PatchCanvas.cpp +++ b/src/libs/gui/PatchCanvas.cpp @@ -375,21 +375,26 @@ PatchCanvas::remove_port(SharedPtr pm) SharedPtr PatchCanvas::get_port_view(SharedPtr port) { - SharedPtr ret; SharedPtr module = _views[port]; // Port on this patch if (module) { - ret = (PtrCast(module)) + return (PtrCast(module)) ? *(PtrCast(module)->ports().begin()) : PtrCast(module); } else { module = PtrCast(_views[port->parent()]); - if (module) - ret = module->get_port(port->path().name()); + if (module) { + for (PortVector::const_iterator p = module->ports().begin(); + p != module->ports().end(); ++p) { + boost::shared_ptr pv = boost::dynamic_pointer_cast(*p); + if (pv && pv->model() == port) + return pv; + } + } } - return ret; + return SharedPtr(); } -- cgit v1.2.1