diff --git a/src/core/operationrunner.cpp b/src/core/operationrunner.cpp index d1ce93f..6ecdc00 100644 --- a/src/core/operationrunner.cpp +++ b/src/core/operationrunner.cpp @@ -29,6 +29,11 @@ #include #include +#include +#include +#include + +#include /** Constructs an OperationRunner. @param ostack the OperationStack to act on @@ -51,6 +56,9 @@ void OperationRunner::run() bool status = true; + int suppressCookie = Solid::PowerManagement::beginSuppressingSleep(i18nc("@info Reason why sleep mode is suppressed", "%1 is performing operations.", KGlobal::mainComponent().aboutData()->programName())); + kDebug() << suppressCookie; + for (int i = 0; i < numOperations(); i++) { suspendMutex().lock(); @@ -83,6 +91,9 @@ void OperationRunner::run() msleep(5); } + if (suppressCookie != -1) + Solid::PowerManagement::stopSuppressingSleep(suppressCookie); + if (!status) emit error(); else if (isCancelling())