This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Desktop integration

Tags: None
(comma "," separated)
dakde
Registered Member
Posts
1
Karma
0

Desktop integration

Thu Nov 26, 2009 10:25 am
Hi everybody,

I'm using Kubuntu 9.10 and I'm a novice at KDE programming. I'm semi-proficient in C and C++, a bit rusty perhaps (using mainly Java for quite some time now).

I'd like to know how to create .desktop links and KDE menu entries programmatically (as in: from some custom-made installer) in C++ or C. As a matter of fact I'd like to do that as generally as possible, on other Linux desktop environments (Gnome, XFCE) as well, but I'd settle for KDE (preferably 4) for now if those things are done in incompatibly different ways. I'd like to use APIs, however, not mess with the config files directly.

If you'd be so kind as to point a few pointers: which libs to use (which packages do I have to have/install), which includes (header files, that is), where do they both typically reside on the file system, which API calls to use, where can I find documentation for all the things I described above, etc.

Thanks,
D.
User avatar
anda_skoa
KDE Developer
Posts
783
Karma
4
OS

Re: Desktop integration

Sat Nov 28, 2009 1:18 pm
.desktop files are basically INI-style key/value pairs in groups.

The same mechanism as well as install locations are shared between Free Software desktop environments, e.g. KDE, GNOME, XFCE.

See http://www.freedesktop.org/wiki/Specifi ... sedir-spec

Most distributions (probably all) ship with a set of shell scripts which help with installing those files, e.g. xdg-desktop-menu. Being non-binary executable they can also be shipped with installers as a fallback if a system one does not exist (a system one should be preferred since it might have received system specific adaptions).

It is obviously also possible to do the writing/copying in any other software as well, as long as it can read environment variables :)

Cheers,
_


anda_skoa, proud to be a member of KDE forums since 2008-Oct.


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]