[gegl/soc-2012-editor: 33/36] Should remove node from graph when deleted in the editor
- From: Isaac Wagner <isaacbw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl/soc-2012-editor: 33/36] Should remove node from graph when deleted in the editor
- Date: Thu, 5 Jul 2012 21:58:59 +0000 (UTC)
commit 6bff69a40586c79b917e34035cc1fdd8e663ac37
Author: Isaac Wagner <isaacbw src gnome org>
Date: Thu Jul 5 14:45:44 2012 -0400
Should remove node from graph when deleted in the editor
bin/editor/gegl-editor-layer.c | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/bin/editor/gegl-editor-layer.c b/bin/editor/gegl-editor-layer.c
index 1f2446e..d74dd10 100644
--- a/bin/editor/gegl-editor-layer.c
+++ b/bin/editor/gegl-editor-layer.c
@@ -47,9 +47,25 @@ void refresh_images(GeglEditorLayer* self)
}
}
-gint layer_node_removed (gpointer host, GeglEditor* editor, gint node)
+gint layer_node_removed (gpointer host, GeglEditor* editor, gint node_id)
{
- g_print("remove node from gegl graph now\n");
+ GeglEditorLayer* self = (GeglEditorLayer*)host;
+ //TODO: put this in its own function
+ GeglNode* node = NULL;
+ GSList* pair = self->pairs;
+ for(;pair != NULL; pair = pair->next)
+ {
+ node_id_pair* data = pair->data;
+ if(data->id == node_id)
+ {
+ node = data->node;
+ break;
+ }
+ }
+
+ g_assert(node != NULL);
+
+ gegl_node_disconnect(self->gegl, node);
}
gint layer_connected_pads (gpointer host, GeglEditor* editor, gint from, gchar* output, gint to, gchar* input)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]