Persistent data with KDED (or KIOD) and a KIO Slave?
David Faure
faure at kde.org
Sat Oct 14 06:27:47 UTC 2017
On dimanche 8 octobre 2017 15:22:00 CEST Mark Gaiser wrote:
> But then i still miss one rather important detail that i can't really find
> anywhere..
> Lets say I have that module and call it "tags2" (as Baloo already has tags,
> therefore tags2 to prevent naming issues).
>
> So i make a dbus service file named:
> Name=org.kde.tags2
>
> And in the "tags2.json" i put:
>
> {
> "KPlugin": {
> "Description": "Put tags on files and folders.",
> "Name": "Tags 2",
> "ServiceTypes": [
> "KDEDModule"
> ]
> },
>
> "X-KDE-DBus-ModuleName": "tags2",
> "X-KDE-DBus-ServiceName": "org.kde.tags2"
> }
>
> What do i do in the client side code to start this module?
You just make a DBus call to the service org.kde.tags, with
object path /modules/tags2. That will start kiod if needed,
load the module, and make the call.
The best solution for this is with type safety rather than without,
i.e. generating C++ from the DBus xml file. See e.g.
kio/core/kpasswdserverclient.cpp which makes calls to the kiod kpasswdserver
module using the generated OrgKdeKPasswdServerInterface class.
qt5_add_dbus_interface() is the cmake function for doing that.
> That "client side" can be an IO slave, but it can also be some special Tags
> helper classes to create a new tag name with description and icon or such.
Sure, anyone can make dbus calls.
> I need to call something to trigger KIOD to start this module, but i can't
> figure out what.
>
> How do i see qCDebug output from kiod plugins anyhow?
In ~/.xsession-errors, or by killing kiod and restarting it in a terminal.
--
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
More information about the Kde-frameworks-devel
mailing list