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:
Ivailo Monev 2023-09-03 00:16:00 +03:00
parent b75a45c5d6
commit 6f822a30bb
2 changed files with 5 additions and 4 deletions

View file

@ -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;