wok view liblxqt/stuff/poweroff+reboot.diff @ rev 21915

updated slib (3b3 -> 3b5)
author Hans-G?nter Theisgen
date Fri Oct 04 17:51:19 2019 +0100 (2019-10-04)
parents
children
line source
1 --- lxqtpower/lxqtpowerproviders.cpp
2 +++ lxqtpower/lxqtpowerproviders.cpp
3 @@ -497,2 +497,10 @@
4 PowerProvider::DontCheckDBUS);
5 + case Power::PowerReboot:
6 + return dbusCall(LXQT_SERVICE, LXQT_PATH, LXQT_SERVICE,
7 + QDBusConnection::sessionBus(), "canReboot",
8 + PowerProvider::DontCheckDBUS);
9 + case Power::PowerShutdown:
10 + return dbusCall(LXQT_SERVICE, LXQT_PATH, LXQT_SERVICE,
11 + QDBusConnection::sessionBus(), "canPoweroff",
12 + PowerProvider::DontCheckDBUS);
13 default:
14 @@ -511,8 +519,2 @@
15 command = "logout";
16 - break;
17 -
18 - default:
19 - return false;
20 - }
21 -
22 return dbusCall(LXQT_SERVICE,
23 @@ -523,2 +525,14 @@
24 );
25 + break;
26 + case Power::PowerReboot:
27 + return QProcess::startDetached("reboot || reboot -f");
28 + break;
29 + case Power::PowerShutdown:
30 + return QProcess::startDetached("poweroff");
31 + break;
32 +
33 + default:
34 + return false;
35 + }
36 +
37 }