aboutsummaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/MachinaCanvas.cpp18
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;