[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to properly register a program in KDE/GNOME

Am Sonntag, den 22.11.2009, 13:03 +0100 schrieb Eric Lavarde:

> thanks for your help, but it didn't... help :-( (yet)
> $ sudo cat /usr/share/applications/freemind.desktop
> [Desktop Entry]
> Version=1.0
> Name=FreeMind
> Exec=/usr/bin/freemind
> Terminal=false
> Icon=FreeMindWindowIcon
> Type=Application
> MimeType=application/x-freemind;
> Categories=Office;
> GenericName=FreeMind
> Comment=A free mind mapping tool
> $ sudo cat /usr/share/mime/packages/freemind.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info";>
>      <mime-type type="application/x-freemind">
>          <comment xml:lang="cs">FreeMind Mapa</comment>
> [...]
>          <comment xml:lang="zh">FreeMind 心智圖</comment>
>          <sub-class-of type="text/xml" />
>          <glob pattern="*.mm"/>
>          <magic priority="85">
>                  <match type="string" value="&lt;map" offset="0"/>
>          </magic>
>      </mime-type>
> </mime-info>
> (you were right, it's an XML format)
> $ sudo update-mime-database /usr/share/mime
> (no output)
> $ xdg-mime query default application/x-freemind
> (no output)

Looks like a bug in xdg-mime to me. I get the same results with several
other known and registered MIME types.

> $ xdg-mime query filetype bla.mm
> text/plain
> $ xdg-mime query filetype New\ Mindmap.mm
> text/html
> (the 2nd file has some HTML embedded)

Ok, that's the problem. If it was XML it must have had the XML
declaration: <?xml version=...?>. But freemind files do not start with
it. So it cannot be of sub-type of application/xml or text/xml. My

Please play a bit with <sub-class-of type="text/plain"/> (text/html
itself is defined as sub-class-of text/plain too). If that still doesn't
work, you might further increase the pattern priority. JFTR: I would
suggest to be more specific in the pattern to let either a space or a >
follow the '<map' pattern.

> Any further ideas? Isn't there somewhere an official documentation on 
> how it's supposed to work?

Of course: http://standards.freedesktop.org.

> Should I use "xdg-mime install" directly to 
> register mime types, and possibly also xdg-icon-resource? Or is there a 
> dh_something function I might have missed?


Regards, Daniel

Reply to: