Changeset View
Changeset View
Standalone View
Standalone View
daemon/backends/upower/powerdevilupowerbackend.cpp
Show First 20 Lines • Show All 310 Lines • ▼ Show 20 Line(s) | 304 | if (m_login1Interface) { | |||
---|---|---|---|---|---|
311 | canHibernate.waitForFinished(); | 311 | canHibernate.waitForFinished(); | ||
312 | if (canHibernate.isValid() && (canHibernate.value() == QLatin1String("yes") || canHibernate.value() == QLatin1String("challenge"))) | 312 | if (canHibernate.isValid() && (canHibernate.value() == QLatin1String("yes") || canHibernate.value() == QLatin1String("challenge"))) | ||
313 | supported |= ToDisk; | 313 | supported |= ToDisk; | ||
314 | 314 | | |||
315 | QDBusPendingReply<QString> canHybridSleep = m_login1Interface.data()->asyncCall("CanHybridSleep"); | 315 | QDBusPendingReply<QString> canHybridSleep = m_login1Interface.data()->asyncCall("CanHybridSleep"); | ||
316 | canHybridSleep.waitForFinished(); | 316 | canHybridSleep.waitForFinished(); | ||
317 | if (canHybridSleep.isValid() && (canHybridSleep.value() == QLatin1String("yes") || canHybridSleep.value() == QLatin1String("challenge"))) | 317 | if (canHybridSleep.isValid() && (canHybridSleep.value() == QLatin1String("yes") || canHybridSleep.value() == QLatin1String("challenge"))) | ||
318 | supported |= HybridSuspend; | 318 | supported |= HybridSuspend; | ||
319 | | ||||
320 | QDBusPendingReply<QString> canSuspendThenHibernate = m_login1Interface.data()->asyncCall("CanSuspendThenHibernate"); | ||||
321 | canSuspendThenHibernate.waitForFinished(); | ||||
322 | if (canSuspendThenHibernate.isValid() && (canSuspendThenHibernate.value() == QLatin1String("yes") || canSuspendThenHibernate.value() == QLatin1String("challenge"))) | ||||
323 | supported |= SuspendThenHibernate; | ||||
319 | } | 324 | } | ||
320 | 325 | | |||
321 | /* There's a chance we're using ConsoleKit rather than ConsoleKit2 as the | 326 | /* There's a chance we're using ConsoleKit rather than ConsoleKit2 as the | ||
322 | * m_login1Interface, so check if we can suspend/hibernate with UPower < 0.99 */ | 327 | * m_login1Interface, so check if we can suspend/hibernate with UPower < 0.99 */ | ||
323 | if (supported == UnknownSuspendMethod) { | 328 | if (supported == UnknownSuspendMethod) { | ||
324 | if (m_upowerInterface->canSuspend() && m_upowerInterface->SuspendAllowed()) { | 329 | if (m_upowerInterface->canSuspend() && m_upowerInterface->SuspendAllowed()) { | ||
325 | qCDebug(POWERDEVIL) << "Can suspend"; | 330 | qCDebug(POWERDEVIL) << "Can suspend"; | ||
326 | supported |= ToRam; | 331 | supported |= ToRam; | ||
▲ Show 20 Lines • Show All 398 Lines • Show Last 20 Lines |