[Xfce4-commits] <xfdesktop:master> load icon file directly if not in theme
Brian J. Tarricone
noreply at xfce.org
Mon Oct 19 00:34:04 CEST 2009
Updating branch refs/heads/master
to f180721dc5313b68f55296ce06c76b7e4ea22817 (commit)
from 3c5e914df587d5ceabae37806a6c64c3377bb8d4 (commit)
commit f180721dc5313b68f55296ce06c76b7e4ea22817
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 d9f99d2..d2ece3e 100644
--- a/panel-plugin/desktop-menu-plugin.c
+++ b/panel-plugin/desktop-menu-plugin.c
@@ -123,17 +123,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) {
@@ -153,7 +154,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