[Xfce4-commits] <xfce4-panel:devel> Avoid warning if drag icon is not in the theme.
Nick Schermer
noreply at xfce.org
Mon Feb 15 19:14:02 CET 2010
Updating branch refs/heads/devel
to c3837f643784299f13c58c4b8bac15f93bc8c20f (commit)
from 0fa6fb4d555bcdeb004098e7ebd10965b523d097 (commit)
commit c3837f643784299f13c58c4b8bac15f93bc8c20f
Author: Nick Schermer <nick at xfce.org>
Date: Mon Feb 15 19:12:16 2010 +0100
Avoid warning if drag icon is not in the theme.
panel/panel-item-dialog.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/panel/panel-item-dialog.c b/panel/panel-item-dialog.c
index abebcec..063ed69 100644
--- a/panel/panel-item-dialog.c
+++ b/panel/panel-item-dialog.c
@@ -443,8 +443,9 @@ panel_item_dialog_drag_begin (GtkWidget *treeview,
GdkDragContext *context,
PanelItemDialog *dialog)
{
- PanelModule *module;
- const gchar *icon_name;
+ PanelModule *module;
+ const gchar *icon_name;
+ GtkIconTheme *theme;
panel_return_if_fail (GTK_IS_TREE_VIEW (treeview));
panel_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
@@ -457,7 +458,9 @@ panel_item_dialog_drag_begin (GtkWidget *treeview,
{
/* set the drag icon */
icon_name = panel_module_get_icon_name (module);
- if (!exo_str_is_empty (icon_name))
+ theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (treeview));
+ 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