mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
solid: implicitly convert the D-Bus reply to the value type in Solid::PowerManagement::beginSuppressingSleep() and Solid::PowerManagement::stopSuppressingSleep()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
b75a45c5d6
commit
6f822a30bb
2 changed files with 5 additions and 4 deletions
|
@ -116,8 +116,9 @@ void Solid::PowerManagement::requestSleep(SleepState state)
|
||||||
uint Solid::PowerManagement::beginSuppressingSleep(const QString &reason)
|
uint Solid::PowerManagement::beginSuppressingSleep(const QString &reason)
|
||||||
{
|
{
|
||||||
QDBusReply<uint> reply = globalPowerManager()->inhibitIface.call("Inhibit", QCoreApplication::applicationName(), reason);
|
QDBusReply<uint> reply = globalPowerManager()->inhibitIface.call("Inhibit", QCoreApplication::applicationName(), reason);
|
||||||
if (reply.isValid())
|
if (reply.isValid()) {
|
||||||
return reply;
|
return reply.value();
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +146,7 @@ uint Solid::PowerManagement::beginSuppressingScreenPowerManagement(const QString
|
||||||
globalPowerManager()->screensaverCookies.append(ssReply.value());
|
globalPowerManager()->screensaverCookies.append(ssReply.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
return ssReply;
|
return ssReply.value();
|
||||||
}
|
}
|
||||||
// No way to fallback on something, hence return failure (0 is invalid cookie)
|
// No way to fallback on something, hence return failure (0 is invalid cookie)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue