From ec0744d2a0773d1aa858c9c1135f77baf25d5a21 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 12 Jan 2013 04:15:34 +0000 Subject: Add missing file. Break up deeply nested code. git-svn-id: http://svn.drobilla.net/lad/trunk/machina@4930 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/MachinaCanvas.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/gui') diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp index 3d01012..ac59376 100644 --- a/src/gui/MachinaCanvas.cpp +++ b/src/gui/MachinaCanvas.cpp @@ -41,7 +41,7 @@ MachinaCanvas::MachinaCanvas(MachinaGUI* app, int width, int height) widget().grab_focus(); signal_event.connect( - sigc::mem_fun(this, &MachinaCanvas::on_event)); + sigc::mem_fun(this, &MachinaCanvas::on_event)); } bool @@ -105,6 +105,10 @@ MachinaCanvas::on_new_object(SharedPtr object) { const Machina::URIs& uris = URIs::instance(); const Raul::Atom& type = object->get(uris.rdf_type); + if (!type.is_valid()) { + return; + } + if (type.get() == uris.machina_Node) { SharedPtr view( new NodeView(_app->window(), *this, object, @@ -115,18 +119,18 @@ MachinaCanvas::on_new_object(SharedPtr object) // view->set_base_color(0x101010FF); view->signal_clicked().connect( - sigc::bind<0>(sigc::mem_fun(this, &MachinaCanvas::node_clicked), - WeakPtr(view))); + sigc::bind<0>(sigc::mem_fun(this, &MachinaCanvas::node_clicked), + WeakPtr(view))); object->set_view(view); } else if (type.get() == uris.machina_Edge) { SharedPtr tail - = _app->client_model()->find( - object->get(uris.machina_tail_id).get_int32()); + = _app->client_model()->find( + object->get(uris.machina_tail_id).get_int32()); SharedPtr head - = _app->client_model()->find( - object->get(uris.machina_head_id).get_int32()); + = _app->client_model()->find( + object->get(uris.machina_head_id).get_int32()); if (!tail || !head) { std::cerr << "Invalid arc" << std::endl; -- cgit v1.2.1