new mime types

David Faure faure at
Sun Jul 31 11:41:50 BST 2005

On Saturday 30 July 2005 14:56, Gerold J. Wucherpfennig wrote:
> Is it possible to define new mime types and don't define them via
> "magic" file or file extention, but by more flexible means?

Usually I'd say no, but in fact in this particular case it should be possible:

> An example:
> Is is possible to define a new mimetype inode/mountpoint
> and set this mime type to local directories whose path is contained
> in /etc/fstab and /etc/mtab?
> I mean how difficult would it be to code something like that and may
> it ever be accepted into kde mainline?

You can define that mimetype and make it inherit from inode/directory 
(using X-KDE-IsAlso) - so that the normal directory viewers can be used for it -
then you need to change the kio_file ioslave to use that mimetype for 
mountpoints (implementation should be fast, e.g. looking up the path 
against a hash of the mountpoint paths, e.g. with QDict). Using KMountPoint 
for a portable way to know the mounted (or mountable) directories.

David Faure, faure at, sponsored by Trolltech to work on KDE,
Konqueror (, and KOffice (

More information about the kde-core-devel mailing list