diff options
Diffstat (limited to 'src/libs/client/Store.cpp')
-rw-r--r-- | src/libs/client/Store.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp index 21470f41..56c6654f 100644 --- a/src/libs/client/Store.cpp +++ b/src/libs/client/Store.cpp @@ -34,6 +34,7 @@ Store::Store(SigClientInterface& emitter) emitter.new_node_sig.connect(sigc::mem_fun(this, &Store::new_node_event)); emitter.new_port_sig.connect(sigc::mem_fun(this, &Store::new_port_event)); emitter.connection_sig.connect(sigc::mem_fun(this, &Store::connection_event)); + emitter.disconnection_sig.connect(sigc::mem_fun(this, &Store::disconnection_event)); emitter.metadata_update_sig.connect(sigc::mem_fun(this, &Store::metadata_update_event)); } @@ -292,5 +293,22 @@ Store::connection_event(const string& src_port_path, const string& dst_port_path } +void +Store::disconnection_event(const string& src_port_path, const string& dst_port_path) +{ + const Path& src = src_port_path; + const Path& dst = dst_port_path; + + assert(src.parent().parent() == dst.parent().parent()); + const Path& patch_path = src.parent().parent(); + + CountedPtr<PatchModel> patch = this->patch(patch_path); + if (patch) + patch->remove_connection(src, dst); + else + cerr << "ERROR: connection in nonexistant patch" << endl; +} + + } // namespace LibOmClient |