wok-current diff liblxqt/stuff/poweroff+reboot.diff @ rev 18862

Up tzdata(2016a)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Jan 28 17:55:47 2016 +0200 (2016-01-28)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/liblxqt/stuff/poweroff+reboot.diff	Thu Jan 28 17:55:47 2016 +0200
     1.3 @@ -0,0 +1,37 @@
     1.4 +--- lxqtpower/lxqtpowerproviders.cpp
     1.5 ++++ lxqtpower/lxqtpowerproviders.cpp
     1.6 +@@ -497,2 +497,10 @@
     1.7 +                             PowerProvider::DontCheckDBUS);
     1.8 ++        case Power::PowerReboot:
     1.9 ++            return dbusCall(LXQT_SERVICE, LXQT_PATH, LXQT_SERVICE,
    1.10 ++                            QDBusConnection::sessionBus(), "canReboot",
    1.11 ++                            PowerProvider::DontCheckDBUS);
    1.12 ++        case Power::PowerShutdown:
    1.13 ++            return dbusCall(LXQT_SERVICE, LXQT_PATH, LXQT_SERVICE,
    1.14 ++                            QDBusConnection::sessionBus(), "canPoweroff",
    1.15 ++                            PowerProvider::DontCheckDBUS);
    1.16 +         default:
    1.17 +@@ -511,8 +519,2 @@
    1.18 +         command = "logout";
    1.19 +-        break;
    1.20 +-
    1.21 +-    default:
    1.22 +-        return false;
    1.23 +-    }
    1.24 +-
    1.25 +     return dbusCall(LXQT_SERVICE,
    1.26 +@@ -523,2 +525,14 @@
    1.27 +             );
    1.28 ++        break;
    1.29 ++    case Power::PowerReboot:
    1.30 ++        return QProcess::startDetached("reboot || reboot -f");
    1.31 ++        break;
    1.32 ++    case Power::PowerShutdown:
    1.33 ++        return QProcess::startDetached("poweroff");
    1.34 ++        break;
    1.35 ++
    1.36 ++    default:
    1.37 ++        return false;
    1.38 ++    }
    1.39 ++
    1.40 + }