Special mime types for directories.

Guillaume Schmid guillaume at maunakeatech.com
Tue May 13 07:56:17 PDT 2008


I am working on port to linux of a medical imaging application and I
have a mime type problem.

The application generates movies stored as a lot of files and meta-data
in a directory. The whole movie is the directory (with all it's files)
and has the .mkt extention.

I would like to be able to display on nautilus, or an other file
browser, a thumbnail instead of the folder icon when displaying the
parent directory.
I wrote a simple thumbnailer that takes 2 parameters: input and output
file and create an image based on the directory content.
I have 2 problems:
1 - Retrieving the correct mime type for the directory (it should be
"application/mkt-bundle" ).
2 - Telling some file explorer application to generate the thumbnail.

What I did:
In  ~/.local/share/mime/packages/mkt-mimetype.xml

<?xml version="1.0"?>
  <mime-type type="application/mkt-bundle">
    <sub-class-of type="inode/directory" />
    <glob pattern="*.mkt" />
    <comment>Mkt bundle movie</comment>


and did a update-mime-database ~/.local/share/mime

I wrote a simple program to display the mime type of a file using the
gio library.
testing a file named "file.mkt" provides the application/mkt-bundle
Testing a directory "dir.mkt" provide also the same type.

I would like only the directory to provide this type. How can I achieve
this ?

Does anybody knows if there is a file browser that will handle this
properly and will allow me ty configure my thumbnailer ?

Thank you for your time.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/xdg/attachments/20080513/058cabe4/attachment.pgp 

More information about the xdg mailing list