wok view liblxqt/stuff/poweroff+reboot.diff @ rev 17420
Up tazusb (4.2.6)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Dec 03 21:07:02 2014 +0100 (2014-12-03) |
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 }