From 6afb455e5a7b194b741af1bdb74f0a9292f6b7e0 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 16 Jun 2008 10:03:16 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20538519=20=E2=80=93=20GtkCellRendererPixbu?= =?UTF-8?q?f=20doesn't=20allow=20unsetting=20the=20icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-06-16 Carlos Garnacho Bug 538519 – GtkCellRendererPixbuf doesn't allow unsetting the icon anymore * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_set_property): Allow again setting any of the properties to render an image back to NULL. svn path=/trunk/; revision=20395 --- ChangeLog | 9 +++++++++ gtk/gtkcellrendererpixbuf.c | 28 ++++++++-------------------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index f9c199df8a..530a3bb087 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-06-16 Carlos Garnacho + + Bug 538519 – GtkCellRendererPixbuf doesn't allow unsetting the icon + anymore + + * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_set_property): + Allow again setting any of the properties to render an image back to + NULL. + 2008-06-15 Matthias Clasen * gtk/gtkimage.c: When pixel-size is specified, use diff --git a/gtk/gtkcellrendererpixbuf.c b/gtk/gtkcellrendererpixbuf.c index fa51cea223..12dc76662a 100644 --- a/gtk/gtkcellrendererpixbuf.c +++ b/gtk/gtkcellrendererpixbuf.c @@ -332,11 +332,8 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object, switch (param_id) { case PROP_PIXBUF: - if (g_value_get_object (value)) - { - unset_image_properties (cellpixbuf); - cellpixbuf->pixbuf = (GdkPixbuf *) g_value_dup_object (value); - } + unset_image_properties (cellpixbuf); + cellpixbuf->pixbuf = (GdkPixbuf *) g_value_dup_object (value); break; case PROP_PIXBUF_EXPANDER_OPEN: if (cellpixbuf->pixbuf_expander_open) @@ -349,11 +346,8 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object, cellpixbuf->pixbuf_expander_closed = (GdkPixbuf*) g_value_dup_object (value); break; case PROP_STOCK_ID: - if (g_value_get_string (value)) - { - unset_image_properties (cellpixbuf); - priv->stock_id = g_value_dup_string (value); - } + unset_image_properties (cellpixbuf); + priv->stock_id = g_value_dup_string (value); break; case PROP_STOCK_SIZE: priv->stock_size = g_value_get_uint (value); @@ -363,21 +357,15 @@ gtk_cell_renderer_pixbuf_set_property (GObject *object, priv->stock_detail = g_value_dup_string (value); break; case PROP_ICON_NAME: - if (g_value_get_string (value)) - { - unset_image_properties (cellpixbuf); - priv->icon_name = g_value_dup_string (value); - } + unset_image_properties (cellpixbuf); + priv->icon_name = g_value_dup_string (value); break; case PROP_FOLLOW_STATE: priv->follow_state = g_value_get_boolean (value); break; case PROP_GICON: - if (g_value_get_object (value)) - { - unset_image_properties (cellpixbuf); - priv->gicon = (GIcon *) g_value_dup_object (value); - } + unset_image_properties (cellpixbuf); + priv->gicon = (GIcon *) g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);