Handle GIcon types other than files and themed icons. Patch from David

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


svn path=/trunk/; revision=14952
This commit is contained in:
Alexander Larsson 2009-02-16 08:50:12 +00:00 committed by Alexander Larsson
parent a7369d3b8f
commit 3a1e67c82b
2 changed files with 24 additions and 2 deletions

View file

@ -1,3 +1,10 @@
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
2009-02-13 Cosimo Cecchi <cosimoc@gnome.org>
* libnautilus-private/nautilus-file.c: (nautilus_file_mount):

View file

@ -410,8 +410,23 @@ nautilus_icon_info_lookup (GIcon *icon,
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 *