API review: KDBusApplicationStarter

David Faure faure at kde.org
Tue May 22 23:17:16 UTC 2012


On Wednesday 23 May 2012 00:52:18 Christoph Feck wrote:
> How immediately is immediately, i.e. does it return before trying to 
> load the segment? What does the return value mean?

Whatever QProcess::start() does :-)

You're right, though, that one returns void, so I should just do the same.

> If it is supposed to return after loading the segment, I rather like 
> non-blocking API, and have an "applicationFailed()" signal, so that it 
> really can return immediately, instead of waiting for the process to 
> load.
> 
> Additionally, even if the application could be loaded, it is still 
> possible it could not register on the bus, for whatever reason, so 
> that's another case for "applicationFailed()".

Very true. For async usage, one needs a signal for the failure case. Added.

    /**
     * Emitted if the process didn't start, or didn't show up on D-Bus after
     * some time.
     */
    void applicationFailed();

Sounds like this needs a setTimeout() too, to make the "time to wait" 
configurable. In practice though, I'm not sure anyone will change that value 
(why should we wait a different amount of time for kttsd, knotify4, kwalletd, 
or kglobalaccel...).
Well, on the other hand a "big" app like kmail might take a bit more time to 
start up... but the timeout would be 30s (value taken from QProcess), and 
using a big app like kmail as a dbus service is hopefully a thing of the past.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by Nokia to work on KDE, incl. KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list