From 5d294bae174c0f5a236a6bf18dd380ea6f9bf875 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 17 Sep 2011 23:00:00 +0000 Subject: Fix "Disconnect" in port context menu (i.e. disconnect_all for ports). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3471 a436a847-0d15-0410-975c-d299462d15a1 --- src/client/ClientStore.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/client') diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index e1ebd97c..d8f36302 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -513,15 +513,20 @@ ClientStore::disconnect_all(const Raul::Path& parent_patch_path, SharedPtr patch = PtrCast(_object(parent_patch_path)); SharedPtr object = _object(path); - if (!patch || !object) + if (!patch || !object) { + std::cerr << "Bad disconnect all notification " << path + << " in " << parent_patch_path << std::endl; return; + } const PatchModel::Connections connections = patch->connections(); for (PatchModel::Connections::const_iterator i = connections.begin(); i != connections.end(); ++i) { SharedPtr c = PtrCast(i->second); if (c->src_port()->parent() == object - || c->dst_port()->parent() == object) { + || c->dst_port()->parent() == object + || c->src_port()->path() == path + || c->dst_port()->path() == path) { c->src_port()->disconnected_from(c->dst_port()); c->dst_port()->disconnected_from(c->src_port()); patch->remove_connection(c->src_port().get(), c->dst_port().get()); -- cgit v1.2.1