wok-current view liblxqt/stuff/poweroff+reboot.diff @ rev 19394
mv pdfgrep to wok-undigest
author | Paul Issott <paul@slitaz.org> |
---|---|
date | Mon Aug 29 17:25:51 2016 +0100 (2016-08-29) |
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 }