[gimp] web-page: Don't update progress too often



commit 2b814b71483a5b146d91fb82d60750eb4ff9f6ef
Author: Mukund Sivaraman <muks banu com>
Date:   Thu Mar 31 12:04:17 2011 +0530

    web-page: Don't update progress too often

 plug-ins/common/web-page.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/common/web-page.c b/plug-ins/common/web-page.c
index 6b970b1..4e25575 100644
--- a/plug-ins/common/web-page.c
+++ b/plug-ins/common/web-page.c
@@ -286,13 +286,18 @@ notify_progress_cb (WebKitWebView  *view,
                     GParamSpec     *pspec,
                     gpointer        user_data)
 {
+  static gdouble old_progress = 0.0;
   gdouble progress;
 
   g_object_get (view,
                 "progress", &progress,
                 NULL);
 
-  gimp_progress_update (progress);
+  if ((progress - old_progress) > 0.01)
+    {
+      gimp_progress_update (progress);
+      old_progress = progress;
+    }
 }
 
 static void



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