Skip navigation.

exploreopera

| Help

Sign up | Help

defaults

, , , , , , ,

I have been asked more than once how Opera on UNIX systems decides which applications are handling which MIME types, and which one of these is chosen as the default handler. Let me start off by saying that this is a jungle: each system, each desktop environment, and possibly each version of the environment handle it in some more or less subtly different way. Freedesktop.org has made some attempts at unifying the system of defaults, and has come some way to deciding how to allow applications to declare which MIME types they can handle - but when it came to define the defaults, unfortunately they could not yet agree. It is work in progress, and managing to have a spec for this will make things much more easy. For the time being we are parsing MIME type handlers, not protocols.


Default handlers

Opera checks the following files to find the default handlers. The XDG_DATA_DIRS environment variable tells us where to find most of those files. Typically in /usr/share/mime/ are

aliases
specifies MIME type strings that are aliases to each other;
globs
aid file for guessing MIME type based on the filename;
subclasses
defines a MIME type to be a subtype of another one, so that any handler of the supertype is also a handler for this type;
application/*.xml
XML file to describe a MIME type;

and we also parse:

mimeinfo.cache
maps MIME types to applications with no specific preference;
defaults.list
GNOME file to specify defaults;
*.desktop
desktop files are available for both applications and MIME types;
mailcap
a configuration file to map MIME types to handlers.

The upcoming kestrel version has improved handling of above resources, and will also handle:

gnome-vfs.applications
lists applications and the MIME types each one supports
kderc
provides among other things the path where to find the KDE settings (typically /etc/kderc)
~/.kde/share/config/profilerc
User specific KDE mapping of MIME types to application (and defaults)

We also parse the index.theme file to make everything look much more pretty :smile:

multi-windowfalling into place

Comments

avatar
We also parse the index.theme file to make everything look much more pretty

Superb, that is a good idea.
What about Qt4?

By towolf, # 5. June 2007, 23:40:22

Write a comment

You must be logged in to write a comment. if you're not a registered member, please sign up.

May 2008
SMTWTFS
April 2008June 2008
123
45678910
11121314151617
18192021222324
25262728293031