# HG changeset patch # User nadvornik # Date 1237319576 0 # Node ID dc406812db14911e058235536d219fd5e6d0f37a # Parent 5c0ecb2ebbc59cda568bc97777013ffe4aa3cc3e fixed loading of desktop file icons, gtk seems to expect an icon name without extension diff -r 5c0ecb2ebbc5 -r dc406812db14 src/pixbuf_util.c --- a/src/pixbuf_util.c Tue Mar 17 19:09:34 2009 +0000 +++ b/src/pixbuf_util.c Tue Mar 17 19:52:56 2009 +0000 @@ -14,6 +14,7 @@ #include "main.h" #include "pixbuf_util.h" #include "exif.h" +#include "ui_fileops.h" #include "icons/icons_inline.h" @@ -178,11 +179,30 @@ { if (error) { - DEBUG_1("Couldn't load icon: %s", error->message); + DEBUG_1("Couldn't load icon %s: %s", icon, error->message); g_error_free(error); + error = NULL; } - return FALSE; + + if (strchr(icon, '.')) + { + /* try again without extension */ + gchar *icon2 = remove_extension_from_path(icon); + pixbuf = gtk_icon_theme_load_icon(icon_theme, + icon2, /* icon name */ + 64, /* size */ + 0, /* flags */ + &error); + if (error) + { + DEBUG_1("Couldn't load icon %s: %s", icon2, error->message); + g_error_free(error); + } + g_free(icon2); + } } + + if (!pixbuf) return FALSE; register_stock_icon(key, pixbuf); return TRUE;