wok view liblxqt/stuff/poweroff+reboot.diff @ rev 20152
Up miniupnp (2.0.20171212), fix get-rar url
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Dec 18 11:31:21 2017 +0100 (2017-12-18) |
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 }