KInhibitionJobTracker Class

Block standby mode while a job is running. More...

Header: #include <KInhibitionJobTracker>
CMake: find_package(KF6 REQUIRED COMPONENTS JobWidgets)
target_link_libraries(mytarget PRIVATE KF6::JobWidgets)
Since: 6.18
Inherits: KJobTrackerInterface

Public Functions

KInhibitionJobTracker(QObject *parent = nullptr)
virtual ~KInhibitionJobTracker() override

Reimplemented Public Functions

virtual void registerJob(KJob *job) override
virtual void unregisterJob(KJob *job) override

Detailed Description

This job tracker will prevent the system from going into standby mode while a given job is running. This can be used to guard potentially lengthy operations, such as copying files, encoding videos, extracting archives, etc.

When the job is started, a power management inhibition is posted after a short delay. When the job is paused, the inhibition is lifted until the job is resumed again.

Member Function Documentation

[explicit] KInhibitionJobTracker::KInhibitionJobTracker(QObject *parent = nullptr)

Creates a new KInhibitionJobTracker

parent the parent object

[override virtual noexcept] KInhibitionJobTracker::~KInhibitionJobTracker()

Creates a new KJobTrackerInterface

parent the parent object

[override virtual] void KInhibitionJobTracker::registerJob(KJob *job)

Reimplements: KJobTrackerInterface::registerJob(KJob *job).

Register a new job in this tracker.

job the job to register

[override virtual] void KInhibitionJobTracker::unregisterJob(KJob *job)

Reimplements: KJobTrackerInterface::unregisterJob(KJob *job).

Unregister a job from this tracker.

job the job to unregister