Skip to content

[handler] Replace QDBusPendingCallWatcher with coroutines

Nicolas Fella requested to merge work/coros into master

Manipulating connections is done using async DBus calls. Currenly we use QDBusPendingCallWatcher to get notified when those finish

All calls trigger the same slot, which them determines what happens based on untyped data that was passed along.

This makes the code quite hard to follow.

By using coroutines we can write the code in a manner that makes the calls appear as if they were sychronous. This allows to reduce some boilerplate and break up the giant slot and move the relevant code to where it logically belongs

That way the code becomes a lot more easy to follow.

This makes use of the QCoro library (https://github.com/danvratil/qcoro) to add coroutine support for QDBusPendingCallWatcher

Edited by Nicolas Fella

Merge request reports

Loading