Comment 30 for bug 1551171

Revision history for this message
In , Eevee-mozilla (eevee-mozilla) wrote :

Thanks a lot, now I'm reading GIO source code. :)

I removed the application/pdf line from my local mimeapps.list and added a junk entry (VLC, certainly not listed in mimeinfo.cache) to the system-wide defaults.list, and now Firefox wants to open PDFs in VLC. So as far as I can tell, this is all working correctly; the only problem *I* had was that KDE doesn't write out its initial defaults in a standard way in the first place.

If you have a defaults.list and it's not working, all I can think is that you also have another file that's overriding it, since it's checked almost-last. The ordering is:
- [Default Applications] in mimeapps.list (GNOME-specific)
- [Added Associations] in mimeapps.list
- [Removed Associations] in mimeapps.list
- defaults.list (GNOME-specific)
- mimeinfo.cache
And each of these files is consulted in order, within each of the directories ~/.local/share/applications, /usr/share/applications, /usr/local/share/applications. Maybe you have some junk in one of those places?

You might want to just put your system-wide configuration in an [Added Associations] section in /usr/share/applications/mimeapps.list anyway, which I believe any DE will understand.

If you want to double-check what GIO thinks is going on without going through Firefox, a pretty easy way is to install the gobject bindings for Python (python-gobject on Ubuntu) and run:

    python -c 'import gio; print gio.app_info_get_all_for_type("application/pdf")'

One other (unlikely) possibility is that you have application/pdf configured as a subtype, and are being bitten by this bug, fixed after 12.04 was released: https://bugzilla.gnome.org/show_bug.cgi?id=678944. Check for a sub-class-of element in your /usr/share/mime/application/pdf.xml.

Anyway, given the above and my own experimentation, I'm reasonably sure that this is not a bug in Firefox. If anything it's a bug in freedesktop; http://www.freedesktop.org/wiki/Specifications/mime-actions-spec/ admits that there's no per-desktop way to specify defaults, and though they call the status quo desktop-specific, it's really toolkit-specific. Firefox is based on GTK+, so it uses the GNOME-specific API.