LWN.net Logo

My personal paper cut

My personal paper cut

Posted Jul 24, 2009 16:49 UTC (Fri) by jimparis (subscriber, #38647)
In reply to: My personal paper cut by cortana
Parent article: Fighting small bugs

Forgive me if I'm dense, but I'm still not seeing what Firefox is doing wrong here. As far as I can tell, it's following the exact same method as everyone else -- it uses /etc/mime.types to map mime-types to file extensions, and it uses /etc/mailcap and ~/.mailcap to choose a default application. If you want to change the default application, then that's the only time you need to open up the file browser -- and I rarely use it to actually browse /usr/bin, I just type the desired executable name directly.

(Incidentally, the Freedesktop.org spec only seems to cover mime types, not mailcap. I don't see which of their specs covers default applications?)


(Log in to post comments)

My personal paper cut

Posted Jul 24, 2009 16:52 UTC (Fri) by jimparis (subscriber, #38647) [Link]

By the way, that's not to say Firefox can't use improvements in this area. For example, bug https://bugzilla.mozilla.org/show_bug.cgi?id=83305 has been an occasional issue for me for many years now -- with upstream's response being basically "blah, I can't be bothered to fix this". One of these days I'll be motivated to fix it myself, but my brief glances into the Firefox code always scare me...

My personal paper cut

Posted Jul 24, 2009 23:06 UTC (Fri) by cortana (subscriber, #24596) [Link]

The problem is that you are an expert, whereas most users--for instance, my parents are not. :)

They will be presented with a file selection dialog box and have no idea that they are supposed to go to /usr/bin, and then wait for Firefox to unfreeze, and then pick one of thousands of similarly named items that have absolutely no connection with what they want to do.

For example, opening a PDF document... how is a normal person supposed to know to select evince? :(

As for the freedesktop.org spec... I actually mis-spoke (typed?) earlier. The spec I mentioned allows programs to declare MIME types (that is, provide a mapping from MIME type to human-readable description). It serves a similar purpose to /etc/mime.types, except that it is more modular (it allows applications to define new MIME types) and it allows for the MIME types to have human-readable descriptions, localized to many different languages.

The spec I should have mentioned is the Desktop Entry spec; this is where applications ship .desktop files (in /usr/share/desktop and other places) that specify (among other things) which MIME types an application may handle. It is similar in purpose to the mailcap mechanism, but again it is more modular and allows internationalization, as well as desktop integration (e.g., application menu entries are derived from the .desktop files).

So, Firefox should be reading these .desktop files and offering the user's default handler for a file, along with a selection of other applications that declare that they handle the MIME type. On my system:

$ grep application/pdf /usr/share/applications/mimeinfo.cache
application/pdf=evince.desktop;gimp.desktop;

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds