summaryrefslogtreecommitdiffstats
path: root/src/libs/client/Store.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-07-04 01:25:48 +0000
committerDavid Robillard <d@drobilla.net>2006-07-04 01:25:48 +0000
commitfefd94019be32da03fcfd4b683860e3461e19000 (patch)
tree4d4d738562c00b68498e086b5d1bd88610aadf71 /src/libs/client/Store.cpp
parent2d518cb42f7707503efc289badb4cac9a3396a17 (diff)
downloadingen-fefd94019be32da03fcfd4b683860e3461e19000.tar.gz
ingen-fefd94019be32da03fcfd4b683860e3461e19000.tar.bz2
ingen-fefd94019be32da03fcfd4b683860e3461e19000.zip
More fixes for connecting/disconnecting
git-svn-id: http://svn.drobilla.net/lad/ingen@83 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client/Store.cpp')
-rw-r--r--src/libs/client/Store.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp
index a8dd69e8..042ea5f5 100644
--- a/src/libs/client/Store.cpp
+++ b/src/libs/client/Store.cpp
@@ -365,17 +365,23 @@ Store::connection_event(const Path& src_port_path, const Path& dst_port_path)
void
Store::disconnection_event(const Path& src_port_path, const Path& dst_port_path)
{
- const Path& src = src_port_path;
- const Path& dst = dst_port_path;
+ // Find the ports and create a ConnectionModel just to get at the parent path
+ // finding logic in ConnectionModel. So I'm lazy.
+
+ CountedPtr<PortModel> src_port = object(src_port_path);
+ CountedPtr<PortModel> dst_port = object(dst_port_path);
+
+ assert(src_port);
+ assert(dst_port);
- assert(src.parent().parent() == dst.parent().parent());
- const Path& patch_path = src.parent().parent();
+ CountedPtr<ConnectionModel> cm = new ConnectionModel(src_port, dst_port);
- CountedPtr<PatchModel> patch = this->object(patch_path);
+ CountedPtr<PatchModel> patch = this->object(cm->patch_path());
+
if (patch)
- patch->remove_connection(src, dst);
+ patch->remove_connection(src_port_path, dst_port_path);
else
- cerr << "ERROR: connection in nonexistant patch" << endl;
+ cerr << "ERROR: disconnection in nonexistant patch" << endl;
}