In KFM documents are not something that comes and goes with applications
like in Win95. KDE works document oriented. This means that the description of
file types is separated from defining the applications. But you may want to
read the section about applications to learn how applications are bound to
file types ( in most OS it is just the other way round ). Every file type has
a single file in the directory tree $KDEDIR/filetypes
. It does
not matter where in this directory tree the file resides.
Lets have a look at an example
[KDE Desktop Entry] Type=FileType Icon=image.xpm Patterns=*.jpeg;*.jpg;*.gif;*.xpm;*.GIF;*.JPG;*.XPM; DefaultApp=XV Comment=Image
The first line is a must and the second one tells us about the type of this
file. The next on tells us which image to use. The image is in the path
$KDEDIR/lib/pics
. Patterns
defines patterns that a
files name must match to be of this type. A pattern is a list of
';
' separated single patterns. If the pattern starts with
'*
' then the pattern is fixed to the end of the filename. If
the pattern ends with '*
' then it is fixed to the start of the
filename. If none of both occurs then the filename must exact match the
expression.
You may now define a default application. The name of the application must
correspond to one file in the $KDEDIR/apps
directory tree. The
default application is invoked for example if you double click on the
file.
Last not least you may give a nice comment. In our case the user will see in the right corner of the status bar that this document is an image if he puts the pointer over the documents icon.
Torben Weis weis@kde.org, weis@stud.uni-frankfurt.de