diff options
author | David Robillard <d@drobilla.net> | 2013-01-12 04:15:34 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-01-12 04:15:34 +0000 |
commit | ec0744d2a0773d1aa858c9c1135f77baf25d5a21 (patch) | |
tree | 538cecd4c40a4f336dc74a3bfe90705dc835136a /src/gui | |
parent | e1a63732f796c8057751cb7f8ac98a595b91692e (diff) | |
download | machina-ec0744d2a0773d1aa858c9c1135f77baf25d5a21.tar.gz machina-ec0744d2a0773d1aa858c9c1135f77baf25d5a21.tar.bz2 machina-ec0744d2a0773d1aa858c9c1135f77baf25d5a21.zip |
Add missing file.
Break up deeply nested code.
git-svn-id: http://svn.drobilla.net/lad/trunk/machina@4930 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/MachinaCanvas.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
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<Client::ClientObject> object) { const Machina::URIs& uris = URIs::instance(); const Raul::Atom& type = object->get(uris.rdf_type); + if (!type.is_valid()) { + return; + } + if (type.get<URIInt>() == uris.machina_Node) { SharedPtr<NodeView> view( new NodeView(_app->window(), *this, object, @@ -115,18 +119,18 @@ MachinaCanvas::on_new_object(SharedPtr<Client::ClientObject> object) // view->set_base_color(0x101010FF); view->signal_clicked().connect( - sigc::bind<0>(sigc::mem_fun(this, &MachinaCanvas::node_clicked), - WeakPtr<NodeView>(view))); + sigc::bind<0>(sigc::mem_fun(this, &MachinaCanvas::node_clicked), + WeakPtr<NodeView>(view))); object->set_view(view); } else if (type.get<URIInt>() == uris.machina_Edge) { SharedPtr<Machina::Client::ClientObject> 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<Machina::Client::ClientObject> 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; |