[gtk+/gtk-3-14] GtkImage: Make resource property work properly



commit fce7f7177230d45cc316924289a721f1833394d5
Author: cedlemo <cedlemo gmx com>
Date:   Wed Jun 24 13:59:00 2015 +0000

    GtkImage: Make resource property work properly
    
    gtk_image_set_from_resource was setting the resource_path,
    only to have it overwritten again before returning. That
    is not as it should be, so change things to set the resource
    path late.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751443

 gtk/gtkimage.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index 80b514d..9655c21 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -1008,8 +1008,6 @@ gtk_image_set_from_resource (GtkImage    *image,
       return;
     }
 
-  priv->resource_path = g_strdup (resource_path);
-
   if (gdk_pixbuf_animation_is_static_image (animation))
     gtk_image_set_from_pixbuf (image, gdk_pixbuf_animation_get_static_image (animation));
   else
@@ -1017,6 +1015,8 @@ gtk_image_set_from_resource (GtkImage    *image,
 
   _gtk_icon_helper_set_pixbuf_scale (priv->icon_helper, scale_factor);
 
+  priv->resource_path = g_strdup (resource_path);
+
   g_object_notify (G_OBJECT (image), "resource");
 
   g_object_unref (animation);


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