[Xfce4-commits] <xfce4-panel:devel> Another warning when the icon is not in the theme.

Nick Schermer noreply at xfce.org
Mon Feb 15 20:02:01 CET 2010


Updating branch refs/heads/devel
         to 2a6e4ee4e16862914c88c9adf16b02336b41f686 (commit)
       from c3837f643784299f13c58c4b8bac15f93bc8c20f (commit)

commit 2a6e4ee4e16862914c88c9adf16b02336b41f686
Author: Nick Schermer <nick at xfce.org>
Date:   Mon Feb 15 20:00:23 2010 +0100

    Another warning when the icon is not in the theme.

 panel/panel-application.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/panel/panel-application.c b/panel/panel-application.c
index b0aa3f2..041b974 100644
--- a/panel/panel-application.c
+++ b/panel/panel-application.c
@@ -382,6 +382,7 @@ panel_application_plugin_move (GtkWidget        *item,
   const gchar    *icon_name;
   GdkDragContext *context;
   PanelModule    *module;
+  GtkIconTheme   *theme;
 
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN_PROVIDER (item));
   panel_return_if_fail (PANEL_IS_APPLICATION (application));
@@ -397,7 +398,9 @@ panel_application_plugin_move (GtkWidget        *item,
   /* set the drag context icon name */
   module = panel_module_get_from_plugin_provider (XFCE_PANEL_PLUGIN_PROVIDER (item));
   icon_name = panel_module_get_icon_name (module);
-  if (G_LIKELY (icon_name != NULL))
+  theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (item));
+  if (!exo_str_is_empty (icon_name)
+      && gtk_icon_theme_has_icon (theme, icon_name))
     gtk_drag_set_icon_name (context, icon_name, 0, 0);
   else
     gtk_drag_set_icon_default (context);



More information about the Xfce4-commits mailing list