• R/O
  • HTTP
  • SSH
  • HTTPS

kde-workspace: Commit

Katana workspace


Commit MetaInfo

Revision42006b194e9c7d0e1aec334627f5738516cf1fe7 (tree)
Time2022-11-30 08:26:58
AuthorIvailo Monev <xakepa10@gmai...>
CommiterIvailo Monev

Log Message

plasma: check if shutdown can be performed from PowerManagementJob::start()

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>

Change Summary

Incremental Difference

--- a/plasma/dataengines/powermanagement/powermanagementjob.cpp
+++ b/plasma/dataengines/powermanagement/powermanagementjob.cpp
@@ -47,8 +47,8 @@ void PowerManagementJob::start()
4747 //kDebug() << "starting operation ... " << operation;
4848
4949 if (operation == "lockScreen") {
50-#warning TODO: error check, also what about inhibitions?
51- const QString interface("org.freedesktop.ScreenSaver");
50+#warning TODO: error check
51+ static const QString interface("org.freedesktop.ScreenSaver");
5252 QDBusInterface screensaver(interface, "/ScreenSaver");
5353 screensaver.asyncCall("Lock");
5454 setResult(true);
@@ -78,6 +78,10 @@ void PowerManagementJob::start()
7878 setResult(true);
7979 return;
8080 } else if (operation == "requestShutDown") {
81+ if (!KWorkSpace::canShutDown()) {
82+ setResult(false);
83+ return;
84+ }
8185 KWorkSpace::requestShutDown();
8286 setResult(true);
8387 return;
Show on old repository browser