[gvfs] afp: set icon from content type



commit f33e000cbfa859ebb3b7b0c7380f33e953389779
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date:   Thu Jun 23 23:05:15 2011 +0200

    afp: set icon from content type

 daemon/gvfsbackendafp.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gvfsbackendafp.c b/daemon/gvfsbackendafp.c
index 28a4e29..f5937b4 100644
--- a/daemon/gvfsbackendafp.c
+++ b/daemon/gvfsbackendafp.c
@@ -234,11 +234,17 @@ static void fill_info (GVfsBackendAfp *afp_backend,
     if (!directory)
     {
       char *content_type;
+      GIcon *icon;
 
       content_type = g_content_type_guess (utf8_name, NULL, 0, NULL);
       g_file_info_set_content_type (info, content_type);
       g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE,
                                         content_type);
+
+      icon = g_content_type_get_icon (content_type);
+      g_file_info_set_icon (info, icon);
+
+      g_object_unref (icon);
       g_free (content_type);
     }
     



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