kdecore/util/klauncher_iface.h - why oh why?
faure at kde.org
Tue Apr 7 10:38:12 BST 2009
On Sunday 05 April 2009, Lubos Lunak wrote:
> could somebody please explain why kdecore installs and exports something that
> - is internal API of KLauncher?
It's the return value of KToolInvocation::klauncher(). It's used by e.g. slave.cpp
to say KToolInvocation::klauncher()->waitForSlave(pid), or by kdebase/workspace/kcontrol/input/main.cpp
to say KToolInvocation::klauncher()->setLaunchEnv(...). lxr.kde.org had such answers btw ;)
So it's not internal API, it's indeed public API. KToolInvocation itself is supposed
to be the public API for the startService* methods, but it doesn't wrap the rest
(todo for kde5?)
Note that I'm explaining the current situation (result of Waldo's initial hacking
and Thiago's port to D-Bus), not saying that it couldn't have been done better for kde4 :-)
> - is a manually included version of something that's easily generated
I agree, that's wrong. I don't even see a custom type that the old qdbusxml2cpp didn't
support, so there's really no reason, even historical.
> - is outdated (and as such different) from when generated again
Related to above point.
> And more importantly, does somebody have any idea how to get rid of it? Was
> that really meant to be public API?
Yes, at least in kde3 and it stayed for kde4 and it has been used, so we can't get rid
of it IMHO.
> The crash I was getting was because ksmserver normally builds its own copy to
> access the klauncher interface
If you fix the kdecore version to be autogenerated, then it will be uptodate and
useable, and you won't need to build your own copy in ksmserver.
> Thinking of it, this generated code should be in anonymous namespace if it is
> not guaranteed that it will stay binary compatible.
Why wouldn't it stay binary compatible? It should... (unless the current version
was generated by a too old version of dbusxml2cpp that did things too differently).
David Faure, faure at kde.org, sponsored by Qt Software @ Nokia to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
More information about the kde-core-devel