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

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



Hi Daniel,

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)

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


Any further ideas? Isn't there somewhere an official documentation on how it's supposed to work? 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?

Thanks, Eric

PS: I'm on the list, no need to copy me.

Daniel Leidert wrote:
Am Samstag, den 21.11.2009, 08:33 +0100 schrieb Eric Lavarde:

I'm trying to get FreeMind files to be properly opened with FreeMind within KDE/GNOME (and probably other freedesktop compatible desktops), e.g. click in Konqueror on a FreeMind file (shown with the FreeMind icon) and FreeMind is opened with the file.

I'm quite at the end of my knowledge and I haven't found a documentation that explains it all.

I have the following:

$ cat /usr/share/applications/freemind.desktop
[Desktop Entry]
[snip]

The Encoding key and the "Application" category are deprecated. The
MimeType line misses the semicolon after the MIME type. JFTR: The icon
field should not contain a path nor a file suffix.

$ 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>
         <glob pattern="*.mm"/>
         <magic priority="65">
                 <match type="string" value="&lt;map" offset="0"/>
         </magic>
     </mime-type>
</mime-info>
(the magic thing is needed to make the difference with troff files)

Is application/x-freemind a subtype of application/octet-stream - some
binary format? If not you *must* add a proper sub-class-of element (e.g.
of text/plain, application/xml, ...). From the magic it looks like an
XML format:

<sub-class-of type="application/xml"/>


You can test the result with the tools gvfs-info, kmimetypefinder and
xdg-mime. Please check the results and post them if necessary.

Regards, Daniel





Reply to: