GNOME Bugzilla – Bug 161773
Open With application not properly set for MIME type aliases
Last modified: 2006-07-14 18:50:27 UTC
A MIME type can have aliases (application/msword is an alias for application/vnd.ms-word) and selecting the preferred application in Nautilus Open With properties only affects one MIME type (the one Nautilus determines through gnome-vfs.) When using the browser a remote server can easily advertise some alias for the same document type failing to take the preferred application into account (because it was set to the "canonical" MIME type instead.) If you download the document locally Nautilus again detects the canonical MIME type instead of the alias. Thus it is impossible to configure preferred application for aliased types. I'm not sure if this is Nautilus or gnome-vfs bug, but if I once set the preferred application for "Microsoft Word Document" that application should be used whichever MIME type alias is given to gnome_vfs_mime_get_default_application()
This is a big problem for downloading via epiphany and firefox when they are using gnome-vfs for determining whether or not a handler is installed.
« I'm not sure if this is Nautilus or gnome-vfs bug, but if I once set the preferred application for "Microsoft Word Document" that application should be used whichever MIME type alias is given to gnome_vfs_mime_get_default_application() » By looking at the code, this is supposed to work: gnome_vfs_mime_get_default_application calls gnome_vfs_mime_get_default_desktop_entry which in turn calls get_all_parents_types. And the first thing get_all_parents_types is to resolve aliases using xdg_mime_unalias_mime_type. I guess this bug report means there's something going wrong there, or that nautilus is doing something more complicated than that. Do you have an url for a file whose mime-type (as sent by the webserver) is not the same as the "canonical" mime type ?
Some example urls, http://patches.theflowerdays.com/bug161773/test.doc -> application/vnd.ms-word http://patches.theflowerdays.com/bug161773/test.pdf -> application/x-pdf http://patches.theflowerdays.com/bug161773/test.xls -> application/msexcel Interestingly, these all work fine for me (the correct helper application is used).
So, in nautilus I added a new helper application for pdf files (I couldn't change the default helper for some reason), then I clicked on crispin's PDF link, and in the helper part of the dialog which appeared, the helper I added was shown. Am I doing the wrong thing to try to reproduce this bug ?
It's not about not getting the helper listed, it's about not being able to set the helper as the default one. Using default settings: * Nautilus recognizes the xls file locally as application/vnd.ms-excel * Open With shows Gnumeric and "OpenOffice.org 1.9 Calc" as suitable applications. (As I have never manually changed the helper application, gnumeric is apparently the system default.) * Both Galeon and Nautilus suggest Gnumeric as the default handler for both local and remote files * There is no specific entry for any excel-like MIME type in ~/.local/share/applications/defaults.list Now pick OOo as the default handler in Nautilus: * Nautilus defaults to OOo, Galeon defaults to Gnumeric * defaults.list contains the line: application/vnd.ms-excel=openoffice.org-1.9-calc.desktop
Playing with the APIs I learned the following after setting OOo as the default handler: application/msexcel (as the the parameter for the following functions): gnome_vfs_mime_get_default_desktop_entry -> NULL gnome_vfs_mime_get_default_application -> gnumeric.desktop application/vnd.ms-excel: gnome_vfs_mime_get_default_desktop_entry -> openoffice.org-1.9-calc.desktop gnome_vfs_mime_get_default_application -> openoffice.org-1.9-calc.desktop
Created attachment 45354 [details] testcase
(gnome-vfs issue, reassigning) that works fine here with GNOME 2.10, what version are you using?
*** Bug 316032 has been marked as a duplicate of this bug. ***
Might be a dup of bug 314952 which is about applications registering themselves for aliases. You may want to try out the attached patch which unaliases the MIME types before building the run-time cache from the disk cache.
Marking as FIXED since the testcase works for me with GnomeVFS 2.15 :). Probably it actually was a dup.