[gegl] Fixed problems causing xml tests to fail
- From: Isaac Wagner <isaacbw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] Fixed problems causing xml tests to fail
- Date: Tue, 31 Jul 2012 16:36:10 +0000 (UTC)
commit 0e551fc48e7fbd8267cb832e489bba06fe6e4932
Author: Isaac Wagner <isaacbw src gnome org>
Date: Tue Jul 31 12:35:57 2012 -0400
Fixed problems causing xml tests to fail
gegl/gegl-xml.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/gegl/gegl-xml.c b/gegl/gegl-xml.c
index 78d7511..a6ae802 100644
--- a/gegl/gegl-xml.c
+++ b/gegl/gegl-xml.c
@@ -257,7 +257,7 @@ static void start_element (GMarkupParseContext *context,
if (!strcmp (element_name, "gegl") ||
!strcmp (element_name, "image"))
{
- GeglNode *new = gegl_node_new();
+ GeglNode *new = g_object_new (GEGL_TYPE_NODE, "operation", "gegl:nop", NULL);
if (pd->gegl == NULL)
{
pd->gegl = new;
@@ -265,8 +265,17 @@ static void start_element (GMarkupParseContext *context,
else
{
}
+
pd->state = STATE_TREE_NORMAL;
pd->parent = g_list_prepend (pd->parent, new);
+
+ if (pd->iter)
+ {
+ gegl_node_get_output_proxy (pd->iter, "output");
+ gegl_node_connect_from (pd->iter, "input", new, "output");
+ }
+
+ pd->iter = gegl_node_get_output_proxy (new, "output");
}
else if (!strcmp (element_name, "graph"))
{
@@ -380,7 +389,7 @@ static void start_element (GMarkupParseContext *context,
}
else
{
- if (pd->iter)
+ if (pd->iter && gegl_node_has_pad(new, "output"))
{
gegl_node_connect_from (pd->iter, "input", new, "output");
}
@@ -1092,6 +1101,9 @@ gegl_node_to_xml (GeglNode *gegl,
ss.clones = g_hash_table_new (NULL, NULL);
ss.terse = FALSE;
+ if(!(gegl->is_graph || gegl->operation))
+ gegl = gegl_node_get_output_proxy(gegl, "output");
+
g_string_append (ss.buf, "<?xml version='1.0' encoding='UTF-8'?>\n");
g_string_append (ss.buf, "<gegl>\n");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]