mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +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 << reason;
|
||||
|
||||
QDBusPendingReply<uint> ssReply = QDBusConnection::sessionBus().asyncCall(message);
|
||||
ssReply.waitForFinished();
|
||||
QDBusReply<uint> ssReply = QDBusConnection::sessionBus().call(message);
|
||||
if (ssReply.isValid()) {
|
||||
globalPowerManager()->screensaverCookies.append(ssReply.value());
|
||||
}
|
||||
|
@ -241,20 +240,16 @@ void Solid::PowerManagementPrivate::slotServiceRegistered(const QString &service
|
|||
);
|
||||
|
||||
// Load all the properties
|
||||
QDBusPendingReply<bool> suspendReply = managerIface->call("CanSuspend");
|
||||
suspendReply.waitForFinished();
|
||||
QDBusReply<bool> suspendReply = managerIface->call("CanSuspend");
|
||||
slotCanSuspendChanged(suspendReply.isValid() ? suspendReply.value() : false);
|
||||
|
||||
QDBusPendingReply<bool> hibernateReply = managerIface->call("CanHibernate");
|
||||
hibernateReply.waitForFinished();
|
||||
QDBusReply<bool> hibernateReply = managerIface->call("CanHibernate");
|
||||
slotCanHibernateChanged(hibernateReply.isValid() ? hibernateReply.value() : false);
|
||||
|
||||
QDBusPendingReply<bool> hybridSuspendReply = managerIface->call("CanHybridSuspend");
|
||||
hybridSuspendReply.waitForFinished();
|
||||
QDBusReply<bool> hybridSuspendReply = managerIface->call("CanHybridSuspend");
|
||||
slotCanHybridSuspendChanged(hybridSuspendReply.isValid() ? hybridSuspendReply.value() : false);
|
||||
|
||||
QDBusPendingReply<bool> saveStatusReply = managerIface->call("GetPowerSaveStatus");
|
||||
saveStatusReply.waitForFinished();
|
||||
QDBusReply<bool> saveStatusReply = managerIface->call("GetPowerSaveStatus");
|
||||
slotPowerSaveStatusChanged(saveStatusReply.isValid() ? saveStatusReply.value() : false);
|
||||
|
||||
connect(managerIface, SIGNAL(CanSuspendChanged(bool)),
|
||||
|
|
Loading…
Add table
Reference in a new issue