aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-11-26 00:36:27 +0000
committerDavid Robillard <d@drobilla.net>2011-11-26 00:36:27 +0000
commit74236c53c3d763f95a9a94dcc400f89546fc2450 (patch)
tree91d0d1da7e1cb9b1fc999cb37daffa5812bf84c8 /src
parent9b33a4a33d9cd7c344fb1c2022e9457948161bd7 (diff)
downloadmachina-74236c53c3d763f95a9a94dcc400f89546fc2450.tar.gz
machina-74236c53c3d763f95a9a94dcc400f89546fc2450.tar.bz2
machina-74236c53c3d763f95a9a94dcc400f89546fc2450.zip
Handle adding and removing connections internally like with items.
git-svn-id: http://svn.drobilla.net/lad/trunk/machina@3635 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/gui/MachinaCanvas.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp
index 2869c22..18d0196 100644
--- a/src/gui/MachinaCanvas.cpp
+++ b/src/gui/MachinaCanvas.cpp
@@ -126,11 +126,7 @@ MachinaCanvas::on_new_object(SharedPtr<Client::ClientObject> object)
SharedPtr<EdgeView> view(
new EdgeView(*this, tail_view, head_view, object));
- tail_view->add_connection(view.get());
- head_view->add_connection(view.get());
-
object->set_view(view);
- add_connection(view.get());
} else {
Raul::error << "Unknown object type " << type << std::endl;
@@ -144,10 +140,7 @@ MachinaCanvas::on_erase_object(SharedPtr<Client::ClientObject> object)
if (type == "machina:Node") {
// Destruction of the view will remove from the canvas
} else if (type == "machina:Edge") {
- SharedPtr<EdgeView> view = PtrCast<EdgeView>(object->view());
- if (view) {
- remove_connection(view->source(), view->dest());
- }
+ object->set_view(SharedPtr<Client::ClientObject::View>());
} else {
Raul::error << "Unknown object type " << type << std::endl;
}