[gtk+/gtk-3-6] iconhelper: Treat the empty string as a NULL stock-id



commit 51484b1223dedf2a5641595112f628fedf272e00
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Oct 26 16:32:14 2012 +0200

    iconhelper: Treat the empty string as a NULL stock-id

 gtk/gtkiconhelper.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c
index 6f23914..49ee9bc 100644
--- a/gtk/gtkiconhelper.c
+++ b/gtk/gtkiconhelper.c
@@ -20,6 +20,7 @@
 #include "config.h"
 
 #include "gtkiconhelperprivate.h"
+#include "string.h"
 
 G_DEFINE_TYPE (GtkIconHelper, _gtk_icon_helper, G_TYPE_OBJECT)
 
@@ -466,7 +467,8 @@ _gtk_icon_helper_set_stock_id (GtkIconHelper *self,
 {
   _gtk_icon_helper_clear (self);
 
-  if (stock_id != NULL)
+  if (stock_id != NULL &&
+      g_strcmp0 (stock_id, "") != 0)
     {
       self->priv->storage_type = GTK_IMAGE_STOCK;
       self->priv->stock_id = g_strdup (stock_id);



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