Bug 189465 - KDE .desktop files and MIME bindings not recognized by other apps
Summary: KDE .desktop files and MIME bindings not recognized by other apps
Status: RESOLVED DOWNSTREAM
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kdecore (show other bugs)
Version: 4.2
Platform: Unlisted Binaries Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-12 16:53 UTC by Michal Witkowski
Modified: 2011-04-24 20:24 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Witkowski 2009-04-12 16:53:00 UTC
Version:            (using KDE 4.2.2)
OS:                Linux
Installed from:    Unspecified Linux

I'm using Arch Linux and it's KDEmod distribution of KDE 4.2.2. I've been trying to get KDE apps recognized by other non-KDE apps (Firefox, Thunderbird, Opera etc.) as appropriate MIME type file openers.

I've used numerous "integration" tips/tweaks and hacks, including the xdg-open one. The problem was, I never had the ability to choose which app to use that way, it always chose the default one. 

I always wondered why, for example xpdf or Openoffice, gets listed and works "out-of-the-box" and KDE apps don't. Then, I stumbled upon the /usr/share/applications directory which stores the .desktop files of all applications which get recognize. KDE apps are also there, but in a subfolder kde4 (/usr/share/applications/kde4). 

This made me think and I've I tried the following trick:
cd /usr/share/applications
for i in kde4/*; do ln -s $i .; done
update-desktop-database -v .
update-mime-database /usr/share/mime

After that, marvelously all other apps (tested Firefox, Thunderbird and Opera) started listing Okular as the default PDF handler, Ark as the default zip handler etc. Everything worked out of the box! No tweaks, no xdg-open hacks, and I could finally choose which application to open my files with. Finally KDE applications started being recognized on par with Gnome apps by Firefox and Thunderbird!

It seems that KDE is the only set of applications which uses a subdirectory in /usr/share/applications, and it seems that it's the main source of problems for other apps following Freedesktop.org's specification. All non-DE apps (xpdf, VirtualBox etc) put their .desktop files there. Heck, Gnome also puts it's applications' desktop files there and their apps get picked up without problems.

I wondered why KDE uses the kde4/ subdirectory. I asked my packagers' about it (http://www.kdemod.ath.cx/bbs/viewtopic.php?id=698), thinking that it was a packaging thing, but they said it came like that from upstream. 

Is there any reason why KDE uses the subdirectory for their .desktop files? Would it be a problem for KDE apps to put their .desktop apps straight into /usr/share/applications? I ask and I'm really interested in the topic, because _SO_ much interoperability can be gained by such a simple modification.

Cheers,
Michal
Comment 1 Aaron J. Seigo 2009-04-12 17:45:32 UTC
it's to allow applications from different versions of kde to be installed side by side without renaming every .desktop file according to the version of kdelibs it uses.

the menu spec (http://standards.freedesktop.org/menu-spec/menu-spec-1.0.html) doesn't specify whether or not subdirectories are allowed in applications/, however update-desktop-database does descend into subdirectories so it's evidently supported.

either way, this absolutely is a downstream issue. if they aren't including those entries in their mimetype database, that's a bug in the packaging.

on my system, kde4/ isn't the subdir in applications/ either :)