balooctl monitor: Exit w/o valid dbus interface
AbandonedPublic

Authored by michaelh on Feb 6 2018, 8:42 AM.

Details

Reviewers
None
Group Reviewers
Baloo
Frameworks
Summary

Exit the application instead of just stopping the event loop

Test Plan
$ balooctl monitor || echo "failed"

Diff Detail

Repository
R293 Baloo
Branch
exit_monitor
Lint
No Linters Available
Unit
No Unit Test Coverage
michaelh created this revision.Feb 6 2018, 8:42 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptFeb 6 2018, 8:42 AM
michaelh requested review of this revision.Feb 6 2018, 8:42 AM

This is the second time I could "resolve" a problem by throwing in a oneshot timer, see also D9590.
I have the feeling something else is wrong here and regard this more as a workaround than a solution. Please comment.

alexeymin added a subscriber: alexeymin.EditedFeb 6 2018, 9:16 AM

quit() and exit(0) do the same thing - they all stop event loop, caused by QCoreApplication::exec(). See - https://code.woboq.org/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp.html#_ZN16QCoreApplication4quitEv

And I don't understand how does timer help? What is happening without singleshot timer?

src/tools/balooctl/monitorcommand.cpp
55

QCoreApplication::exit() is a static member function and can be called directly without using instance().
instance()->quit() is exactly the same as exit(0) so I don't understand this change. It does not change anything and looks not correct.

@alexeymin: Sorry, for the huge delay.

And I don't understand how does timer help? What is happening without singleshot timer?

I don't quite understand either.
Without it you won't get your prompt back until you Ctrl+C.

michaelh abandoned this revision.Feb 16 2018, 11:41 AM

Superseded by D10578