[KDE Dot News]
 faq
 flatforty
 contribute
 subscribe
 configure
 search
 rdf

 main
 parent


Registering multiple mime types
by Arun on Wednesday 12/May/2004, @20:54
If I am writing a KFile plugin for say Java .class files, there are multiple mime types in use for them - application/java, application/java-byte-code, application/java-vm, application/x-java-class, application/x-java-byte-code - to name a few.

How do I register all of them as associated with the same plugin class? Is it by multiple calls to addMimeTypeInfo?

How about the .desktop file? Do I add multiple MimeType entries there?
  Related Links
 ·   Articles on Developer
 ·   Also by Arun
 ·   Contact author

Thread Threshold:

The Fine Print: The following comments are owned by whomever posted them.
( Reply )

Re: Registering multiple mime types
by Arun on Sunday 16/May/2004, @17:43
I figured out the answers to the two questions myself.

In the .desktop, all the mime types need to be in the same MimeType entry like this:
MimeType=application/java;application/java-byte-code;application/java-vm;application/x-java;application/x-java-class;application/x-java-byte-code
I believe regular expressions are also allowed.

In the plugin class, multiple calls should be made to addMimeTypeInfo for each type and all the groups, items need to be added to each KFileMimeTypeInfo.

I have a small KFile plugin for .class files at http://arun.homeip.net/kdev/kfile_class_src.zip if anyone is interested.
[ Reply To This | View ]
The Fine Print: The previous comments are owned by whomever posted them.
( Reply )

  "I tried to play with some toy applications and enjoyed it." -- Werner Trobin
KDE®, "K Desktop Environment", "KDE Dot News", "got the dot?" and the KDE Logo® are trademarks or registered trademarks of KDE e.V. in the European Union, the United States and other countries. All other trademarks and copyrights on this page are owned by their respective owners. Comments are owned by the poster. The rest: Copyright © 2000-2008 KDE e.V. for The KDE Project. For further information or comments on this site, please contact the Webmaster.
[ home | post article | flat forty | subscribe | search | rdf ]