[glib] win32: Make g_content_type_get_mime_type work for directories
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] win32: Make g_content_type_get_mime_type work for directories
- Date: Fri, 5 Jun 2015 16:31:23 +0000 (UTC)
commit 96df2727f4c120a9fec888a2840f60ac3c3edde9
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jun 5 12:30:15 2015 -0400
win32: Make g_content_type_get_mime_type work for directories
Now that we are using inode/directory for directories, handle
this case in g_content_type_get_mime_type() as well.
gio/gcontenttype-win32.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gio/gcontenttype-win32.c b/gio/gcontenttype-win32.c
index 2db8bd7..04d8fd3 100644
--- a/gio/gcontenttype-win32.c
+++ b/gio/gcontenttype-win32.c
@@ -158,6 +158,7 @@ g_content_type_get_description (const gchar *type)
if (g_content_type_is_unknown (type))
return g_strdup (_("Unknown type"));
+
return g_strdup_printf (_("%s filetype"), type);
}
@@ -175,6 +176,8 @@ g_content_type_get_mime_type (const gchar *type)
return g_strdup ("application/octet-stream");
else if (*type == '.')
return g_strdup_printf ("application/x-ext-%s", type+1);
+ else if (strcmp ("inode/directory", type) == 0)
+ return g_strdup (type);
/* TODO: Map "image" to "image/ *", etc? */
return g_strdup ("application/octet-stream");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]