[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Adding MIME-types and .desktop files using CMake
From:       Lubos Lunak <l.lunak () suse ! cz>
Date:       2010-09-07 11:49:01
Message-ID: 201009071349.01694.l.lunak () suse ! cz
[Download RAW message or body]

On Tuesday 07 of September 2010, Amir Pakdel wrote:
> >> Hi developers,
> >>
> >> I am trying to add a MIME type for "Basket Note Pads" files so that
> >> Desktop Environments (KDE and GNOME) can recognise them. For that
> >> purpose, I created a basket.xml and included the MIME type in the
> >> basket.desktop file; then, I have added the MIME
> >> type and associated this MIME type with the basket.desktop using the
> >> following commands:
> >>
> >> xdg-mime install --novendor basket.xml
> >> xdg-desktop-menu install --novendor basket.desktop
> >> xdg-mime default basket.desktop application/x-basket-item
> >>
> >> This procedure seems work fine, but I cannot add it to the CMake. I
> >> mean, I cannot do it automatically during installation via CMake
> >> rules.

 You do not need to use tools like xdg-mime. In fact, you probably should not, 
as I seriously doubt they support features like $DESTDIR. You can search the 
main KDE modules for cases where this is already done.

 Mimetypes, as already shown by Pedro, are done like this: 
http://websvn.kde.org/*checkout*/trunk/KDE/kdelibs/mimetypes/CMakeLists.txt

 Installing a .desktop file, for example: 
http://websvn.kde.org/*checkout*/trunk/KDE/kdebase/apps/kwrite/CMakeLists.txt

 And setting a default handler for a mimetype is something you should not do 
by default in CMake. It will not work with binary packages, for example. As 
it is your application's own mimetype anyway, there's no point in doing that.

-- 
 Lubos Lunak
 openSUSE Boosters team, KDE developer
 l.lunak@suse.cz , l.lunak@kde.org
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic