nautilus r14952 - in trunk: . libnautilus-private



Author: alexl
Date: Mon Feb 16 08:50:12 2009
New Revision: 14952
URL: http://svn.gnome.org/viewvc/nautilus?rev=14952&view=rev

Log:
2009-02-16  Alexander Larsson  <alexl redhat com>

        * libnautilus-private/nautilus-icon-info.c:
        (nautilus_icon_info_lookup):
	Handle GIcon types other than files and themed icons.
	Patch from David Zeuthen



Modified:
   trunk/ChangeLog
   trunk/libnautilus-private/nautilus-icon-info.c

Modified: trunk/libnautilus-private/nautilus-icon-info.c
==============================================================================
--- trunk/libnautilus-private/nautilus-icon-info.c	(original)
+++ trunk/libnautilus-private/nautilus-icon-info.c	Mon Feb 16 08:50:12 2009
@@ -410,8 +410,23 @@
 		gtk_icon_info_free (gtkicon_info);
 
 		return g_object_ref (icon_info);
-	} 
-	return nautilus_icon_info_new_for_pixbuf (NULL);
+	} else {
+                GdkPixbuf *pixbuf;
+                GtkIconInfo *gtk_icon_info;
+
+                gtk_icon_info = gtk_icon_theme_lookup_by_gicon (gtk_icon_theme_get_default (),
+                                                                icon,
+                                                                size,
+                                                                GTK_ICON_LOOKUP_GENERIC_FALLBACK);
+                if (gtk_icon_info != NULL) {
+                        pixbuf = gtk_icon_info_load_icon (gtk_icon_info, NULL);
+                        gtk_icon_info_free (gtk_icon_info);
+                } else {
+                        pixbuf = NULL;
+                }
+
+                return nautilus_icon_info_new_for_pixbuf (pixbuf);
+        }
 }
 
 NautilusIconInfo *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]