[epiphany] ephy-download-widget: Check the icon has changed before updating the image



commit e83e965f4d59773d3f54fdfd85f1c862c45d6111
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Tue Jun 5 18:10:33 2012 +0200

    ephy-download-widget: Check the icon has changed before updating the image

 lib/widgets/ephy-download-widget.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/lib/widgets/ephy-download-widget.c b/lib/widgets/ephy-download-widget.c
index 0ef240b..0c84420 100644
--- a/lib/widgets/ephy-download-widget.c
+++ b/lib/widgets/ephy-download-widget.c
@@ -137,11 +137,14 @@ download_clicked_cb (GtkButton *button,
 static void
 update_download_icon (EphyDownloadWidget *widget)
 {
-  GIcon *new_icon;
+  GIcon *new_icon, *old_icon;
 
   new_icon = get_gicon_from_download (widget->priv->download);
-  gtk_image_set_from_gicon (GTK_IMAGE (widget->priv->icon), new_icon,
-                            GTK_ICON_SIZE_LARGE_TOOLBAR);
+  gtk_image_get_gicon (GTK_IMAGE (widget->priv->icon), &old_icon, NULL);
+  if (!g_icon_equal (new_icon, old_icon)) {
+    gtk_image_set_from_gicon (GTK_IMAGE (widget->priv->icon), new_icon,
+                              GTK_ICON_SIZE_LARGE_TOOLBAR);
+  }
   g_object_unref (new_icon);
 }
 



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