[gvfs] afp: guess content type from filename
- From: Christian Kellner <gicmo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] afp: guess content type from filename
- Date: Thu, 25 Aug 2011 19:23:43 +0000 (UTC)
commit 137e94ccb5712ef5f8f082e00dde0956489fb706
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date: Wed Jun 22 23:01:04 2011 +0200
afp: guess content type from filename
daemon/gvfsbackendafp.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gvfsbackendafp.c b/daemon/gvfsbackendafp.c
index a9cc575..d961635 100644
--- a/daemon/gvfsbackendafp.c
+++ b/daemon/gvfsbackendafp.c
@@ -229,6 +229,17 @@ static void fill_info (GVfsBackendAfp *afp_backend,
/* Set file as hidden if it begins with a dot */
if (utf8_name[0] == '.')
g_file_info_set_is_hidden (info, TRUE);
+
+ if (!directory)
+ {
+ char *content_type;
+
+ 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);
+ g_free (content_type);
+ }
g_free (utf8_name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]