[nautilus/gnome-2-28] Add nautilus_icon_info_lookup_from_path()
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [nautilus/gnome-2-28] Add nautilus_icon_info_lookup_from_path()
- Date: Wed, 25 Nov 2009 08:08:42 +0000 (UTC)
commit e60d5e25b010f58f34231b160c90592a13b9efe8
Author: Pierre Wieser <pwieser trychlos org>
Date: Wed Nov 25 08:31:39 2009 +0100
Add nautilus_icon_info_lookup_from_path()
(cherry picked from commit 36d83807cc0744e131e3532714849a7d1bbbf65d)
libnautilus-private/nautilus-icon-info.c | 17 ++++++++++++++++-
libnautilus-private/nautilus-icon-info.h | 2 ++
2 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/libnautilus-private/nautilus-icon-info.c b/libnautilus-private/nautilus-icon-info.c
index f1ddd7c..f39ad42 100644
--- a/libnautilus-private/nautilus-icon-info.c
+++ b/libnautilus-private/nautilus-icon-info.c
@@ -435,13 +435,28 @@ nautilus_icon_info_lookup_from_name (const char *name,
{
GIcon *icon;
NautilusIconInfo *info;
-
+
icon = g_themed_icon_new (name);
info = nautilus_icon_info_lookup (icon, size);
g_object_unref (icon);
return info;
}
+NautilusIconInfo *
+nautilus_icon_info_lookup_from_path (const char *path,
+ int size)
+{
+ GFile *icon_file;
+ GIcon *icon;
+ NautilusIconInfo *info;
+
+ icon_file = g_file_new_for_path (path);
+ icon = g_file_icon_new (icon_file);
+ info = nautilus_icon_info_lookup (icon, size);
+ g_object_unref (icon);
+ g_object_unref (icon_file);
+ return info;
+}
GdkPixbuf *
nautilus_icon_info_get_pixbuf_nodefault (NautilusIconInfo *icon)
diff --git a/libnautilus-private/nautilus-icon-info.h b/libnautilus-private/nautilus-icon-info.h
index d6f5b2f..5ef6cd2 100644
--- a/libnautilus-private/nautilus-icon-info.h
+++ b/libnautilus-private/nautilus-icon-info.h
@@ -58,6 +58,8 @@ NautilusIconInfo * nautilus_icon_info_lookup (GIcon
int size);
NautilusIconInfo * nautilus_icon_info_lookup_from_name (const char *name,
int size);
+NautilusIconInfo * nautilus_icon_info_lookup_from_path (const char *path,
+ int size);
gboolean nautilus_icon_info_is_fallback (NautilusIconInfo *icon);
GdkPixbuf * nautilus_icon_info_get_pixbuf (NautilusIconInfo *icon);
GdkPixbuf * nautilus_icon_info_get_pixbuf_nodefault (NautilusIconInfo *icon);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]