Review Request 125483: [KDBusService] Don't exit after calling Activate if user specified NoExitOnFailure flag

David Faure faure at kde.org
Sat Oct 3 08:01:44 UTC 2015



> On Oct. 2, 2015, 8:35 p.m., David Faure wrote:
> > Sending Activate to a running Unique process is not a failure, so NoExitOnFailure should not affect it.
> > 
> > If you need a "no exit, ever" flag, then I would recommend adding a separate flag for that. I'm not sure I understand the use case though.
> 
> Martin Klapetek wrote:
>     In terms of the this code, the "failure" is "!d->registered" (see line 147 or 153 with this patch), so it is a failure to register the service (this is also supported by the docs saying "Indicates that the application should not exit if it failed to register with D-Bus."). So even if it sends Activate, it still failed to register the service and therefore the NoExitOnFailure should apply. No?

While that might be one way to literally interpret the docs, it's definitely not what I had in mind when I wrote them.
See "Already running so it's ok!", the fact that there is no "errorMessage" set in this case, and the fact that the current use of NoExitOnFailure happens right before qCritical() + exit.

Process already running is not an error or a failure, it's a perfectly normal situation.

What I can't really remember is the use case for NoExitOnFailure; I think it was "being able to start the app even if there's no DBus running at all", at the expense of losing the Unique behavior of course.

Back to your use case, I wonder why "pass data" can't be done with the CommandLine method. Or are we talking about different data than the command line? Which other data could there be, in an application we just started ?


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125483/#review86249
-----------------------------------------------------------


On Oct. 2, 2015, 5:52 p.m., Martin Klapetek wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125483/
> -----------------------------------------------------------
> 
> (Updated Oct. 2, 2015, 5:52 p.m.)
> 
> 
> Review request for KDE Frameworks and David Faure.
> 
> 
> Repository: kdbusaddons
> 
> 
> Description
> -------
> 
> If KDBusService fails to register Unique service because other instance is already running and if the user specified NoExitOnFailure, don't exit after calling "Activate" on the other instance.
> 
> 
> Diffs
> -----
> 
>   src/kdbusservice.cpp ea7727d 
> 
> Diff: https://git.reviewboard.kde.org/r/125483/diff/
> 
> 
> Testing
> -------
> 
> App no longer exits and can do some other tasks like calling a different dbus method to eg. pass data and then exit on its own.
> 
> 
> Thanks,
> 
> Martin Klapetek
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20151003/4dafafd3/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list