summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d842b7e)
raw | patch | inline | side by side (parent: d842b7e)
author | joncruz <joncruz@users.sourceforge.net> | |
Mon, 30 Mar 2009 09:36:22 +0000 (09:36 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Mon, 30 Mar 2009 09:36:22 +0000 (09:36 +0000) |
src/widgets/icon.cpp | patch | blob | history |
diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp
index 0bed152f8e338714cc75d5c689d33d522d766e5f..220ffc722ab2dff99e18030a72a2e8b3aece5944 100644 (file)
--- a/src/widgets/icon.cpp
+++ b/src/widgets/icon.cpp
@@ -908,6 +908,9 @@ static void addToIconSet(GdkPixbuf* pb, gchar const* name, GtkIconSize lsize, un
for ( std::vector<IconCacheItem>::iterator it = iconSetCache[name].begin(); it != iconSetCache[name].end(); ++it ) {
if ( it->_lsize == lsize ) {
+ if (dump) {
+ g_message(" erasing %s:%d %p", name, it->_lsize, it->_pb);
+ }
iconSetCache[name].erase(it);
break;
}
if (pb) {
return false;
} else {
- pb = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), name, psize,
- (GtkIconLookupFlags) 0, NULL);
+ GtkIconTheme* theme = gtk_icon_theme_get_default();
+ if ( gtk_icon_theme_has_icon(theme, name) ) {
+ gint *sizeArray = gtk_icon_theme_get_icon_sizes( theme, name );
+ for (gint* cur = sizeArray; *cur; cur++) {
+ if (static_cast<gint>(psize) == *cur) {
+ pb = gtk_icon_theme_load_icon( theme, name, psize,
+ (GtkIconLookupFlags) 0, NULL );
+ break;
+ }
+ }
+ g_free(sizeArray);
+ sizeArray = 0;
+ }
if (!pb) {
+ if (dump) {
+ g_message("prerender_icon [%s] %d", name, psize);
+ }
guchar* px = load_svg_pixels(name, lsize, psize);
if ( !px ) {
// check for a fallback name
g_message("XXXXXXXXXXXXXXXXXXXXXXXXXXXXX error!!! pixels not found for '%s'", name);
}
}
+ else if (dump) {
+ g_message("prerender_icon [%s] %d NOT!!!!!!", name, psize);
+ }
if (pb) {
pb_cache[key] = pb;