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

updated bluefish (2.2.0 -> 2.2.10)
author Hans-G?nter Theisgen
date Mon Feb 11 17:14:38 2019 +0100 (2019-02-11)
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 }