KDBusService, Open and ActivateAction
Alex Merry
kde at randomguy3.me.uk
Tue Nov 12 13:40:06 UTC 2013
This question is mainly directed at David Faure and Kevin Ottens, as the
authors of KDBusService, but to provide context for everyone else,
KDBusService implements (among other things) the D-Bus activation scheme
from the desktop entry spec
(http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s07.html).
This specifies three actiation methods: Activate(), Open(uris) and
ActivateAction(action_name, param).
When the application is specified as being Unique, the KDBusService
constructor of a second instance will call Activate() on the first
instance and then quit. This means that any command line arguments to
that second instance, including file names, will be lost.
What it should probably do is call Open or ActivateAction as
appropriate. My question is how it should determine this.
One option is to require a certain pattern for command line arguments.
For example, all positional arguments are files (well, URIs) and we
could have --action=foo to indicate an action called foo (and take the
first positional arg, if any, as the parameter).
Another is to provide a way for the application to pass in the parsed
arguments (specifically a list of files or an action name and
parameter); this gets slightly awkward as this has to be passed or not
passed (decided at runtime) to the constructor.
Finally, the QVariantMap platform_data that is passed to every method
could be used/abused to forward the arguments unparsed to the main
process (always using Activate and never Open or ActivateAction), and
the activateRequested signal altered to forward these.
Thoughts?
Alex
More information about the Kde-frameworks-devel
mailing list