After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 161773 - Open With application not properly set for MIME type aliases
Open With application not properly set for MIME type aliases
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: MIME and file/program mapping
2.9.x
Other Linux
: High major
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
: 316032 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-12-20 11:37 UTC by Tommi Komulainen
Modified: 2006-07-14 18:50 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
testcase (595 bytes, text/plain)
2005-04-17 14:00 UTC, Tommi Komulainen
Details

Description Tommi Komulainen 2004-12-20 11:37:23 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()
Comment 1 Luis Villa 2005-02-01 13:12:31 UTC
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.
Comment 2 Christophe Fergeau 2005-04-17 12:36:27 UTC
« 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 ?
Comment 3 Crispin Flowerday (not receiving bugmail) 2005-04-17 12:59:52 UTC
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).
Comment 4 Christophe Fergeau 2005-04-17 13:25:29 UTC
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 ?
Comment 5 Tommi Komulainen 2005-04-17 13:30:08 UTC
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
Comment 6 Tommi Komulainen 2005-04-17 13:48:32 UTC
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
Comment 7 Tommi Komulainen 2005-04-17 14:00:06 UTC
Created attachment 45354 [details]
testcase
Comment 8 Sebastien Bacher 2005-05-08 14:34:59 UTC
(gnome-vfs issue, reassigning)

that works fine here with GNOME 2.10, what version are you using?
Comment 9 Christian Neumair 2005-09-13 18:20:17 UTC
*** Bug 316032 has been marked as a duplicate of this bug. ***
Comment 10 Christian Neumair 2006-04-06 15:02:25 UTC
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.
Comment 11 Christian Neumair 2006-07-14 18:50:27 UTC
Marking as FIXED since the testcase works for me with GnomeVFS 2.15 :). Probably it actually was a dup.