[Xfce4-commits] r30352 - libexo/trunk/exo

Nick Schermer nick at xfce.org
Sun Jul 19 17:58:43 CEST 2009


Author: nick
Date: 2009-07-19 15:58:43 +0000 (Sun, 19 Jul 2009)
New Revision: 30352

Modified:
   libexo/trunk/exo/exo-toolbars-editor.c
   libexo/trunk/exo/exo-toolbars-view.c
Log:
Fix critical warnings if pixbuf is not found, ellipsize labels.


Modified: libexo/trunk/exo/exo-toolbars-editor.c
===================================================================
--- libexo/trunk/exo/exo-toolbars-editor.c	2009-07-19 15:31:07 UTC (rev 30351)
+++ libexo/trunk/exo/exo-toolbars-editor.c	2009-07-19 15:58:43 UTC (rev 30352)
@@ -316,12 +316,14 @@
     {
       gtk_image_get_stock (image, &stock_id, NULL);
       pixbuf = gtk_widget_render_icon (widget, stock_id, GTK_ICON_SIZE_LARGE_TOOLBAR, NULL);
-      gtk_drag_source_set_icon_pixbuf (widget, pixbuf);
+      if (G_LIKELY (pixbuf != NULL))
+        gtk_drag_source_set_icon_pixbuf (widget, pixbuf);
     }
   else if (type == GTK_IMAGE_PIXBUF)
     {
       pixbuf = gtk_image_get_pixbuf (image);
-      gtk_drag_source_set_icon_pixbuf (widget, pixbuf);
+      if (G_LIKELY (pixbuf != NULL))
+        gtk_drag_source_set_icon_pixbuf (widget, pixbuf);
     }
 }
 
@@ -367,6 +369,8 @@
 
   text_no_mnemonic = exo_str_elide_underscores (text);
   label = gtk_label_new (text_no_mnemonic);
+  gtk_widget_set_tooltip_text (ebox, text_no_mnemonic);
+  gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
   gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
   g_free (text_no_mnemonic);
   gtk_widget_show (label);

Modified: libexo/trunk/exo/exo-toolbars-view.c
===================================================================
--- libexo/trunk/exo/exo-toolbars-view.c	2009-07-19 15:31:07 UTC (rev 30351)
+++ libexo/trunk/exo/exo-toolbars-view.c	2009-07-19 15:58:43 UTC (rev 30352)
@@ -507,8 +507,11 @@
       id = "separator";
 
       pixbuf = _exo_toolbars_new_separator_pixbuf ();
-      gtk_drag_source_set_icon_pixbuf (item, pixbuf);
-      g_object_unref (G_OBJECT (pixbuf));
+      if (G_LIKELY (pixbuf != NULL))
+        {
+          gtk_drag_source_set_icon_pixbuf (item, pixbuf);
+          g_object_unref (G_OBJECT (pixbuf));
+        }
     }
   else
     {
@@ -519,8 +522,11 @@
         stock_id = g_strdup (GTK_STOCK_DND);
 
       pixbuf = gtk_widget_render_icon (item, stock_id, GTK_ICON_SIZE_LARGE_TOOLBAR, NULL);
-      gtk_drag_source_set_icon_pixbuf (item, pixbuf);
-      g_object_unref (G_OBJECT (pixbuf));
+      if (G_LIKELY (pixbuf != NULL))
+        {
+          gtk_drag_source_set_icon_pixbuf (item, pixbuf);
+          g_object_unref (G_OBJECT (pixbuf));
+        }
 
       g_free (stock_id);
     }




More information about the Xfce4-commits mailing list