From 74236c53c3d763f95a9a94dcc400f89546fc2450 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 26 Nov 2011 00:36:27 +0000 Subject: 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 --- src/gui/MachinaCanvas.cpp | 9 +-------- 1 file changed, 1 insertion(+), 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 object) SharedPtr 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 object) if (type == "machina:Node") { // Destruction of the view will remove from the canvas } else if (type == "machina:Edge") { - SharedPtr view = PtrCast(object->view()); - if (view) { - remove_connection(view->source(), view->dest()); - } + object->set_view(SharedPtr()); } else { Raul::error << "Unknown object type " << type << std::endl; } -- cgit v1.2.1