CopyJob: Inhibit suspend during copy operation

Avoids the system going to sleep during a lengthy copy operation.

BUG: 362542

core: Add infrastructure for inhibiting suspend in jobs

This calls the freedesktop Inhibit interface on DBus which will inhibit suspend (but not display power management/screensaver).

When a job is destroyed or gets suspended, the inhibition is lifted. When a job is resumed, doInhibitSuspend is called again to re-instate the inhibition.

It is the job's responsibility to call doInhibitSuspend at the appropriate time (e.g. in doStart/slotStart).


I don’t react to result/finished but just the destructor. Should be fine, though, as the KIO jobs auto-delete usually?

We could roll that out to further jobs if we wanted but let’s do it with copy job first that’s typically the one that takes a long time.

@jpetso @davidedmundson

Screenshot_20250420_122236

The label is misleading, it doesn’t keep the screen on (FDO inhibit interface is only suspend)

Merge request reports

Loading
Loading