[gimp] app: clean up the GEGL progress code a bit



commit 1b71731cb8e6c9ab17a85343e50e4fa4429615d3
Author: Michael Natterer <mitch gimp org>
Date:   Wed Mar 23 22:53:09 2016 +0100

    app: clean up the GEGL progress code a bit
    
    Includes code from Massimo from bug #763135.

 app/gegl/gimp-gegl-utils.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/app/gegl/gimp-gegl-utils.c b/app/gegl/gimp-gegl-utils.c
index 8655ac1..d3e7289 100644
--- a/app/gegl/gimp-gegl-utils.c
+++ b/app/gegl/gimp-gegl-utils.c
@@ -73,25 +73,29 @@ gimp_gegl_color_new (const GimpRGB *rgb)
 }
 
 static void
-gimp_gegl_progress_notify (GObject          *object,
-                           gdouble           value,
-                           GimpProgress     *progress)
+gimp_gegl_progress_callback (GObject      *object,
+                             gdouble       value,
+                             GimpProgress *progress)
 {
   const gchar *text;
 
-
   text = g_object_get_data (object, "gimp-progress-text");
 
   if (text)
     {
       if (value == 0.0)
         {
-          gimp_progress_start (progress, FALSE, "%s", text);
+          if (gimp_progress_is_active (progress))
+            gimp_progress_set_text (progress, "%s", text);
+          else
+            gimp_progress_start (progress, FALSE, "%s", text);
+
           return;
         }
       else if (value == 1.0)
         {
           gimp_progress_end (progress);
+
           return;
         }
     }
@@ -114,7 +118,7 @@ gimp_gegl_progress_connect (GeglNode     *node,
   g_return_if_fail (operation != NULL);
 
   g_signal_connect (operation, "progress",
-                    G_CALLBACK (gimp_gegl_progress_notify),
+                    G_CALLBACK (gimp_gegl_progress_callback),
                     progress);
 
   if (text)


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