GNOME Bugzilla – Bug 385085
SMB method should respect SLOW_MIME_TYPE
Last modified: 2006-12-18 17:36:52 UTC
Create a JPEG file and rename it to "picture", without an extension. If it's on a file:/// volume, you can double-click on it in Nautilus and it will get opened properly. However, if the file is on an smb:/// volume, Nautilus will tell you that it can't open the file. This happens because smb-method.c only does "fast" MIME checking, based on the filename extension. If the file doesn't have an extension, the method simply returns "application/octet-stream". The attached patch makes smb-method.c pay attention to the GnomeVFSFileInfo flags, so that requesting GNOME_VFS_FILE_INFO_FORCE_SLOW_MIME_TYPE will actually sniff the file. With the patch, Nautilus can open that "picture" file just fine on SMB volumes.
Created attachment 78209 [details] [review] gnome-vfs2-385085-smb-method-sniff-mime-type.diff
Committed to gnome-2-16 and HEAD. 2006-12-18 Federico Mena Quintero <federico@novell.com> Fix http://bugzilla.gnome.org/show_bug.cgi?id=385085 (same as https://bugzilla.novell.com/show_bug.cgi?id=195269). When opening SMB files with no extension or unknown extension, the proper MIME type doesn't get sniffed. * modules/smb-method.c (do_get_file_info): If we have GNOME_VFS_FILE_INFO_FORCE_SLOW_MIME_TYPE, then use gnome_vfs_get_mime_type_common() to cause the file to be sniffed. Otherwise, call gnome_vfs_mime_type_from_name_or_default() as usual.