Mimetype Activation (Was: Shared mimetypes + activation)

Thomas Leonard tal00r at ecs.soton.ac.uk
Sat May 1 14:30:42 EEST 2004


On Fri, Apr 30, 2004 at 05:44:50PM -0400, Jonathan Blandford wrote:
> Alexander Larsson <alexl at redhat.com> writes:
> 
> > Another important thing to keep in mind here is mime aliases. If we e.g.
> > add a mime type for .php files (say text/x-phpsrc) suddenly all *.php
> > files are of that type, and an editor registered to handle text/plain
> > won't be used to open it. So, we need some sort of aliases, allowing you
> > to have a specific default handler for text/x-phpsrc, but if none
> > exists, we use the one for text/plain. And the list of all apps handling
> > the file should contain both the text/plain and the text/x-phpsrc
> > handlers.
> 
> I don't know if this really belongs in the spec.

What you actually want are subclasses, not aliases. A subclass says that
and file of type text/x-phpsrc can also be treated as text/plain (but not
the other way around). An alias would say that text/plain and
text/x-phpsrc are the same type and can always be treated identically.

Aliases and subclasses are both already in the spec (although the copy on
the web page still hasn't been updated; is anyone responsible for updating
this? Who used to update it?).

There are some implicit subclasses (eg, text/* is-a text/plain, all
regular files subclass application/octet-stream), and a field allows
explicit subclasses. This is all fully implemented, although there may be
some/many subclasses missing from the database (submit a patch if you find
any).

Support for aliases (where we rename one type to another for some reason)
is also in the spec. In the future, we may generate an aliases file to
speed lookups of aliases. However, I think there's only one alias in the
whole database at the moment, so there's no point yet (and the OP really
wanted subclasses instead).


-- 
Thomas Leonard			http://rox.sourceforge.net
tal00r at ecs.soton.ac.uk	tal197 at users.sourceforge.net
GPG: 9242 9807 C985 3C07 44A6  8B9A AE07 8280 59A5 3CC1




More information about the xdg mailing list