summaryrefslogtreecommitdiffstats
path: root/src/libs/gui/PatchCanvas.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-09-15 04:25:14 +0000
committerDavid Robillard <d@drobilla.net>2008-09-15 04:25:14 +0000
commit1e0424662ba99a9d73f05d818341942c6df23c09 (patch)
tree2056ddd64aaecb65a716eb697bb329d892ae6228 /src/libs/gui/PatchCanvas.cpp
parentfccfce4b1e9c9f80b38d20dd8f0e90fe83a93068 (diff)
downloadingen-1e0424662ba99a9d73f05d818341942c6df23c09.tar.gz
ingen-1e0424662ba99a9d73f05d818341942c6df23c09.tar.bz2
ingen-1e0424662ba99a9d73f05d818341942c6df23c09.zip
Fix connecting when human names are visible.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1503 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui/PatchCanvas.cpp')
-rw-r--r--src/libs/gui/PatchCanvas.cpp15
1 files changed, 10 insertions, 5 deletions
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<PortModel> pm)
SharedPtr<FlowCanvas::Port>
PatchCanvas::get_port_view(SharedPtr<PortModel> port)
{
- SharedPtr<FlowCanvas::Port> ret;
SharedPtr<FlowCanvas::Module> module = _views[port];
// Port on this patch
if (module) {
- ret = (PtrCast<PatchPortModule>(module))
+ return (PtrCast<PatchPortModule>(module))
? *(PtrCast<PatchPortModule>(module)->ports().begin())
: PtrCast<FlowCanvas::Port>(module);
} else {
module = PtrCast<NodeModule>(_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<GUI::Port> pv = boost::dynamic_pointer_cast<GUI::Port>(*p);
+ if (pv && pv->model() == port)
+ return pv;
+ }
+ }
}
- return ret;
+ return SharedPtr<FlowCanvas::Port>();
}