[gnome-photos] pipeline: Avoid using photos_pipeline_undo



commit b604a86b85264c0542a86a5d4e3b4f71d175d427
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Feb 16 20:41:34 2016 +0100

    pipeline: Avoid using photos_pipeline_undo
    
    The undo API, the way it is implemented, doesn't match with the current
    realities of our UX. Therefore, we need to replace it with something
    that meets our needs.
    
    In this case, we were using it to ensure that the graph was empty
    before resetting it. Instead we can add a pre-condition that asserts
    the emptiness of the graph.

 src/photos-pipeline.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/photos-pipeline.c b/src/photos-pipeline.c
index 41f8c59..30293a8 100644
--- a/src/photos-pipeline.c
+++ b/src/photos-pipeline.c
@@ -470,14 +470,15 @@ void
 photos_pipeline_reset (PhotosPipeline *self)
 {
   GeglNode *input;
+  GeglNode *last;
   GeglNode *node;
   GeglNode *output;
 
-  while (photos_pipeline_undo (self))
-    ;
-
   input = gegl_node_get_input_proxy (self->graph, "input");
   output = gegl_node_get_output_proxy (self->graph, "output");
+  last = gegl_node_get_producer (output, "input", NULL);
+  g_return_if_fail (last == input);
+
   node = gegl_node_new_child (self->graph,
                               "operation", "photos:insta-filter",
                               "preset", PHOTOS_OPERATION_INSTA_PRESET_NONE,


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