[Xfce4-commits] <xfdesktop:libxfce4ui> load icon file directly if not in theme
Brian J. Tarricone
noreply at xfce.org
Wed Oct 7 00:00:02 CEST 2009
Updating branch refs/heads/libxfce4ui
to 5e1aafe77ed45feb49feb8f92aa9deb3e5d76ba8 (commit)
from 185ddcfe8dd494a2caaeaa639eb7514c068826b3 (commit)
commit 5e1aafe77ed45feb49feb8f92aa9deb3e5d76ba8
Author: Brian J. Tarricone <brian at tarricone.org>
Date: Tue Oct 6 14:58:22 2009 -0700
load icon file directly if not in theme
panel-plugin/desktop-menu-plugin.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/panel-plugin/desktop-menu-plugin.c b/panel-plugin/desktop-menu-plugin.c
index 83cbc92..5f80fc9 100644
--- a/panel-plugin/desktop-menu-plugin.c
+++ b/panel-plugin/desktop-menu-plugin.c
@@ -120,17 +120,18 @@ dmp_get_icon(const gchar *icon_name, gint size, GtkOrientation orientation)
const gchar *filename;
gint w, h;
- iinfo = gtk_icon_theme_lookup_icon(itheme, icon_name, size, 0);
- if(!iinfo)
- return NULL;
-
w = orientation == GTK_ORIENTATION_HORIZONTAL ? -1 : size;
h = orientation == GTK_ORIENTATION_VERTICAL ? -1 : size;
- filename = gtk_icon_info_get_filename(iinfo);
+ iinfo = gtk_icon_theme_lookup_icon(itheme, icon_name, size, 0);
+ if(iinfo)
+ filename = gtk_icon_info_get_filename(iinfo);
+ else
+ filename = icon_name;
+
if(filename)
pix = gdk_pixbuf_new_from_file_at_scale(filename, w, h, TRUE, NULL);
- else {
+ else if(iinfo) {
GdkPixbuf *tmp = gtk_icon_info_get_builtin_pixbuf(iinfo);
if(tmp) {
@@ -150,7 +151,8 @@ dmp_get_icon(const gchar *icon_name, gint size, GtkOrientation orientation)
}
}
- gtk_icon_info_free(iinfo);
+ if(iinfo)
+ gtk_icon_info_free(iinfo);
return pix;
}
More information about the Xfce4-commits
mailing list