KDE switched to XDG shared-mime-info

Matt Rogers mattr at kde.org
Tue Mar 20 23:57:47 GMT 2007


On Mar 20, 2007, at 7:52 AM, David Faure wrote:

> I forgot to announce it before so here it is:
>
> I have changed kdelibs yesterday, with the help of Pino Toscano, to  
> use the
> standard mimetype database from freedesktop.org
> (http://standards.freedesktop.org/shared-mime-info-spec/latest)
> instead of defining our own mimetypes in kdelibs.
> Well, we still define a few mimetypes that are not in the shared  
> repository,
> but most of them do come from shared-mime-info, and the move of those
> mimetypes to shared-mime-info is an on-going process.
>
> There are a number of reasons for doing that:
>  * Improving compatibility with other free desktops (e.g. when  
> sending a file
> over email the receiver will get a mimetype his system understands)
>  * Improving compatibility with web servers (I think Apache already
> implements, or will implement, support for shared-mime-info instead  
> of having
> its own mimetype database too).
>  * A bit less maintainance on our side
>  * And the most important benefit is for third-party application  
> makers. They
> will be able to install a single mimetype file to define the  
> mimetype(s)
> specific to their application, instead of having to install one  
> file per
> desktop as is the case currently.
>
> IMPORTANT: what this means for you:
>
>  1) you should unset XDG_DATA_DIRS.
> Earlier setup instructions suggested to set it in order to keep kde3
> applications out of the way, but that hack breaks now, we need the xdg
> mimetype files to be found, so we can't set XDG_DATA_DIRS away  
> from /usr.
> Let's make sure kde3 apps work in kde4 instead [e.g. I renamed  
> kbuildsycoca to
> kbuildsycoca4 yesterday].
>
>  2) you should install shared-mime-info. Given that gnome has been  
> using it
> for quite some time, it is packaged already on all distributions,  
> you don't
> have to compile anything yourself. Except on Windows, obviously.
> 0.18 is the minimum version, but 0.20 is recommended since it  
> includes a
> number of fixes in the mimetype definitions.
>
>  3) you shouldn't write code that parses mimetype .desktop files, use
> KMimeType::mimeType() instead (e.g. I fixed ark to do that).
>
>  4) you shouldn't ship a mimetype with your application. Well, that  
> has always
> been true ;) kdelibs was the mimetype repository, and from now on  
> if you
> define a new mimetype for your application, either define it in
> kdelibs/mimetypes/kde.xml, or if this type of file can be sent  
> (e.g. over
> email) to people not using kde, then better register the mimetype at
> http://www.freedesktop.org/Standards/AddingMIMETutor

What do we do if we need to ship a new mimetype with our application  
because it doesn't exist in kdelibs yet and it's not in previous  
releases and it's not been put upstream into shared-mime-info? I'm  
thinking of mimetypes that might be added after 4.0.0 and before  
4.0.1 as an example.
--
Matt






More information about the kde-core-devel mailing list