summaryrefslogtreecommitdiffstats
path: root/src/libs/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/client')
-rw-r--r--src/libs/client/PatchModel.cpp2
-rw-r--r--src/libs/client/Store.cpp20
2 files changed, 15 insertions, 7 deletions
diff --git a/src/libs/client/PatchModel.cpp b/src/libs/client/PatchModel.cpp
index d79fa74b..27f0361a 100644
--- a/src/libs/client/PatchModel.cpp
+++ b/src/libs/client/PatchModel.cpp
@@ -209,6 +209,7 @@ PatchModel::add_connection(CountedPtr<ConnectionModel> cm)
void
PatchModel::remove_connection(const string& src_port_path, const string& dst_port_path)
{
+ cerr << path() << " PatchModel::remove_connection: " << cm->src_port_path() << " -> " << cm->dst_port_path() << endl;
for (list<CountedPtr<ConnectionModel> >::iterator i = m_connections.begin(); i != m_connections.end(); ++i) {
CountedPtr<ConnectionModel> cm = (*i);
if (cm->src_port_path() == src_port_path && cm->dst_port_path() == dst_port_path) {
@@ -218,6 +219,7 @@ PatchModel::remove_connection(const string& src_port_path, const string& dst_por
return;
}
}
+
cerr << "[PatchModel::remove_connection] WARNING: Failed to find connection " <<
src_port_path << " -> " << dst_port_path << endl;
}
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;
}