[gnome-photos] pipeline: Also look at the compat-name when deserializing the graph



commit 49466baae5537df7aca9a989728128bd47f26fdc
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Mar 4 14:13:24 2016 +0100

    pipeline: Also look at the compat-name when deserializing the graph
    
    Sometimes, we might want to use a different name for an operation in
    the XML serialization of the graph. Since the XML is created with the
    GeglOperation's "name" key, we would use "compat-name" for the
    internal name of the operation. Therefore, we need to look at the
    "compat-name" when creating the mapping from operation names to
    GeglNodes.

 src/photos-pipeline.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-pipeline.c b/src/photos-pipeline.c
index 1d82342..2db7943 100644
--- a/src/photos-pipeline.c
+++ b/src/photos-pipeline.c
@@ -121,6 +121,7 @@ photos_pipeline_create_graph_from_xml (PhotosPipeline *self, gchar *contents)
   for (l = children; l != NULL; l = l->next)
     {
       const gchar *operation;
+      const gchar *operation_compat;
 
       node = GEGL_NODE (l->data);
 
@@ -131,6 +132,10 @@ photos_pipeline_create_graph_from_xml (PhotosPipeline *self, gchar *contents)
 
       operation = gegl_node_get_operation (node);
       g_hash_table_insert (self->hash, g_strdup (operation), g_object_ref (node));
+
+      operation_compat = gegl_operation_get_key (operation, "compat-name");
+      if (operation_compat != NULL)
+        g_hash_table_insert (self->hash, g_strdup (operation_compat), g_object_ref (node));
     }
 
   node = GEGL_NODE (children->data);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]