[gnome-photos] operation-insta-filter: Remove an extra gegl:nop for the NONE preset



commit 453fcc3d8ff152364006378a20a513e6bb6bd194
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Oct 27 12:51:15 2017 +0200

    operation-insta-filter: Remove an extra gegl:nop for the NONE preset

 src/photos-operation-insta-filter.c |   35 +++++++++++++++++++----------------
 1 files changed, 19 insertions(+), 16 deletions(-)
---
diff --git a/src/photos-operation-insta-filter.c b/src/photos-operation-insta-filter.c
index fa6dad5..136e089 100644
--- a/src/photos-operation-insta-filter.c
+++ b/src/photos-operation-insta-filter.c
@@ -63,10 +63,6 @@ photos_operation_insta_filter_setup (PhotosOperationInstaFilter *self)
   switch (self->preset)
     {
     case PHOTOS_OPERATION_INSTA_PRESET_NONE:
-      node = gegl_node_new_child (operation->node,
-                                  "operation", "gegl:nop",
-                                  NULL);
-      self->nodes = g_list_prepend (self->nodes, node);
       break;
 
     case PHOTOS_OPERATION_INSTA_PRESET_1977:
@@ -117,21 +113,28 @@ photos_operation_insta_filter_setup (PhotosOperationInstaFilter *self)
       break;
     }
 
-  node = GEGL_NODE (self->nodes->data);
-  gegl_node_link (self->input, node);
-
-  for (l = self->nodes; l != NULL && l->next != NULL; l = l->next)
+  if (self->nodes == NULL)
     {
-      GeglNode *sink = GEGL_NODE (l->next->data);
-      GeglNode *source = GEGL_NODE (l->data);
-
-      gegl_node_link (source, sink);
-      gegl_operation_meta_watch_node (operation, source);
+      gegl_node_link (self->input, self->output);
     }
+  else
+    {
+      node = GEGL_NODE (self->nodes->data);
+      gegl_node_link (self->input, node);
+
+      for (l = self->nodes; l != NULL && l->next != NULL; l = l->next)
+        {
+          GeglNode *sink = GEGL_NODE (l->next->data);
+          GeglNode *source = GEGL_NODE (l->data);
 
-  node = GEGL_NODE (l->data);
-  gegl_node_link (node, self->output);
-  gegl_operation_meta_watch_node (operation, node);
+          gegl_node_link (source, sink);
+          gegl_operation_meta_watch_node (operation, source);
+        }
+
+      node = GEGL_NODE (l->data);
+      gegl_node_link (node, self->output);
+      gegl_operation_meta_watch_node (operation, node);
+    }
 }
 
 


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