gvfs r1411 - in trunk: . daemon



Author: hadess
Date: Thu Feb 28 10:36:57 2008
New Revision: 1411
URL: http://svn.gnome.org/viewvc/gvfs?rev=1411&view=rev

Log:
2008-02-28  Bastien Nocera  <hadess hadess net>

	* daemon/gvfsbackendobexftp-fl-parser.c (fl_parser_start_node_cb):
	Set the content-type on files by having a good guess if we didn't
	get a mime-type from the folder listings



Modified:
   trunk/ChangeLog
   trunk/daemon/gvfsbackendobexftp-fl-parser.c

Modified: trunk/daemon/gvfsbackendobexftp-fl-parser.c
==============================================================================
--- trunk/daemon/gvfsbackendobexftp-fl-parser.c	(original)
+++ trunk/daemon/gvfsbackendobexftp-fl-parser.c	Thu Feb 28 10:36:57 2008
@@ -115,13 +115,13 @@
 		return;
 	}
 
-	//FIXME
-#if 0
-	if (info->mime_type == NULL) {
-		info->mime_type = g_strdup (
-			gnome_vfs_mime_type_from_name (info->name));
+	if (g_file_info_get_content_type (info) == NULL) {
+		char *mime_type;
+		mime_type = g_content_type_guess (g_file_info_get_name (info), NULL, 0, NULL);
+		g_file_info_set_content_type (info, mime_type);
+		g_free (mime_type);
 	}
-#endif
+
 	/* Permissions on folders in OBEX has different semantics than POSIX.
 	 * In POSIX, if a folder is not writable, it means that it's content
 	 * can't be removed, whereas in OBEX, it just means that the folder



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