MIME Activation

Angus Lees gus at inodes.org
Mon Apr 14 11:45:56 BST 2003


At Sun, 13 Apr 2003 16:43:06 +0200, David Faure wrote:
> On Sunday 13 April 2003 04:25, Owen Taylor wrote:
> >  - Since multiple handlers for one format are likely, it has to work
> >    as "I can handle audio/x-mp3" not "I am the handler for audio/x-mp3"
> > 
> >    (I don't think there should be any way of setting the default from
> >    an application install perspective, because an application never
> >    knows if it should be the default.)
> 
> Yes. This is why we have an InitialPreference field in KDE's desktop
> files.  The higher the value, the most "preferred" the app will
> be.

yes, Debian's update-mime(8) supports a "priority" mailcap field (0-9,
defaulting to 5).

as the entries are merged into a single mailcap file, they are sorted
by this value.

> It turns out that this field isn't enough, for instance Karbon
> (vector drawing app) should have a high InitialPreference for its
> own native mimetype, but should be rather low as a PostScript
> handler (it can import PS files)

the way this has been dealt with in the past was for apps to ignore
mailcap for certain mime types.  a typical example is netscape
(version 4 and earlier at least) which had:

  certain mime types marked as "internal" which it handled internally
  (text/html, image/gif, etc of course, also other formats supported
  by plugins) without consulting mailcap files,

  a gui for users to define overrides (which it wrote out to
  ~/.mailcap),

  and then would fallback to the system /etc/mailcap

> So my request would be that there is an "initial preference" number
> per application+mimetype combination.
> Then we could say things like:
> Karbon+application/x-vnd.kde.karbon = 10
> Karbon+application/postscript=2
> KGhostview+application/postscript=10

if this does have to be user configurable beyond the above simple
mechanism, i'd be inclined to just have mailcap files specific to such
apps, which was inserted in the search order before the normal
mailcap.

users could even achieve something similar on a case-by-case basis by
setting MAILCAP appropriately before running the app.

i would hope the need for such complicated setups is rare.

-- 
 - Gus




More information about the kde-core-devel mailing list