diff options
author | David Robillard <d@drobilla.net> | 2011-09-17 23:00:00 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-09-17 23:00:00 +0000 |
commit | 5d294bae174c0f5a236a6bf18dd380ea6f9bf875 (patch) | |
tree | 82abb92563eb2435217dbb051a348b1e1e9bb4e9 /src | |
parent | 780cba275bf47f14680f65970941c1ba45cceecb (diff) | |
download | ingen-5d294bae174c0f5a236a6bf18dd380ea6f9bf875.tar.gz ingen-5d294bae174c0f5a236a6bf18dd380ea6f9bf875.tar.bz2 ingen-5d294bae174c0f5a236a6bf18dd380ea6f9bf875.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/client/ClientStore.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
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<PatchModel> patch = PtrCast<PatchModel>(_object(parent_patch_path)); SharedPtr<ObjectModel> 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<ConnectionModel> c = PtrCast<ConnectionModel>(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()); |