mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 10:52:49 +00:00
solid: call power manager method synchronously
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
80c30dc690
commit
77fd0a79b1
1 changed files with 5 additions and 10 deletions
|
@ -140,8 +140,7 @@ int Solid::PowerManagement::beginSuppressingScreenPowerManagement(const QString&
|
||||||
message << QCoreApplication::applicationName();
|
message << QCoreApplication::applicationName();
|
||||||
message << reason;
|
message << reason;
|
||||||
|
|
||||||
QDBusPendingReply<uint> ssReply = QDBusConnection::sessionBus().asyncCall(message);
|
QDBusReply<uint> ssReply = QDBusConnection::sessionBus().call(message);
|
||||||
ssReply.waitForFinished();
|
|
||||||
if (ssReply.isValid()) {
|
if (ssReply.isValid()) {
|
||||||
globalPowerManager()->screensaverCookies.append(ssReply.value());
|
globalPowerManager()->screensaverCookies.append(ssReply.value());
|
||||||
}
|
}
|
||||||
|
@ -241,20 +240,16 @@ void Solid::PowerManagementPrivate::slotServiceRegistered(const QString &service
|
||||||
);
|
);
|
||||||
|
|
||||||
// Load all the properties
|
// Load all the properties
|
||||||
QDBusPendingReply<bool> suspendReply = managerIface->call("CanSuspend");
|
QDBusReply<bool> suspendReply = managerIface->call("CanSuspend");
|
||||||
suspendReply.waitForFinished();
|
|
||||||
slotCanSuspendChanged(suspendReply.isValid() ? suspendReply.value() : false);
|
slotCanSuspendChanged(suspendReply.isValid() ? suspendReply.value() : false);
|
||||||
|
|
||||||
QDBusPendingReply<bool> hibernateReply = managerIface->call("CanHibernate");
|
QDBusReply<bool> hibernateReply = managerIface->call("CanHibernate");
|
||||||
hibernateReply.waitForFinished();
|
|
||||||
slotCanHibernateChanged(hibernateReply.isValid() ? hibernateReply.value() : false);
|
slotCanHibernateChanged(hibernateReply.isValid() ? hibernateReply.value() : false);
|
||||||
|
|
||||||
QDBusPendingReply<bool> hybridSuspendReply = managerIface->call("CanHybridSuspend");
|
QDBusReply<bool> hybridSuspendReply = managerIface->call("CanHybridSuspend");
|
||||||
hybridSuspendReply.waitForFinished();
|
|
||||||
slotCanHybridSuspendChanged(hybridSuspendReply.isValid() ? hybridSuspendReply.value() : false);
|
slotCanHybridSuspendChanged(hybridSuspendReply.isValid() ? hybridSuspendReply.value() : false);
|
||||||
|
|
||||||
QDBusPendingReply<bool> saveStatusReply = managerIface->call("GetPowerSaveStatus");
|
QDBusReply<bool> saveStatusReply = managerIface->call("GetPowerSaveStatus");
|
||||||
saveStatusReply.waitForFinished();
|
|
||||||
slotPowerSaveStatusChanged(saveStatusReply.isValid() ? saveStatusReply.value() : false);
|
slotPowerSaveStatusChanged(saveStatusReply.isValid() ? saveStatusReply.value() : false);
|
||||||
|
|
||||||
connect(managerIface, SIGNAL(CanSuspendChanged(bool)),
|
connect(managerIface, SIGNAL(CanSuspendChanged(bool)),
|
||||||
|
|
Loading…
Add table
Reference in a new issue