[gtk+/places-sidebar] Replacement for the NautilusIconInfo machinery
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/places-sidebar] Replacement for the NautilusIconInfo machinery
- Date: Tue, 4 Oct 2011 22:13:32 +0000 (UTC)
commit 54fcd98aeb9aaafa47e01662972f2a973b9d2cb1
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Oct 4 17:07:59 2011 -0500
Replacement for the NautilusIconInfo machinery
Signed-off-by: Federico Mena Quintero <federico gnome org>
gtk/gtkplacessidebar.c | 26 +++++++++++++++++++-------
1 files changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index dc591ef..d234fb7 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -360,6 +360,24 @@ check_heading_for_section (GtkPlacesSidebar *sidebar,
}
}
+static GdkPixbuf *
+get_pixbuf_from_gicon (GtkPlacesSidebar *sidebar, GIcon *icon)
+{
+ int icon_size;
+ GtkIconTheme *icon_theme;
+ GtkIconInfo *icon_info;
+ GdkPixbuf *pixbuf;
+
+ icon_theme = gtk_icon_theme_get_default ();
+ icon_size = get_icon_size (sidebar);
+ icon_info = gtk_icon_theme_lookup_by_gicon (icon_theme, icon, icon_size, 0);
+
+ pixbuf = gtk_icon_info_load_icon (icon_info, NULL); /* NULL-GError */
+ gtk_icon_info_free (icon_info);
+
+ return pixbuf;
+}
+
static GtkTreeIter
add_place (GtkPlacesSidebar *sidebar,
PlaceType place_type,
@@ -376,18 +394,12 @@ add_place (GtkPlacesSidebar *sidebar,
GdkPixbuf *pixbuf;
GtkTreeIter iter, child_iter;
GdkPixbuf *eject;
- NautilusIconInfo *icon_info;
- int icon_size;
gboolean show_eject, show_unmount;
gboolean show_eject_button;
check_heading_for_section (sidebar, section_type);
- icon_size = get_icon_size (sidebar);
- icon_info = nautilus_icon_info_lookup (icon, icon_size);
-
- pixbuf = nautilus_icon_info_get_pixbuf_at_size (icon_info, icon_size);
- g_object_unref (icon_info);
+ pixbuf = get_pixbuf_from_gicon (sidebar, icon);
check_unmount_and_eject (mount, volume, drive,
&show_unmount, &show_eject);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]