Changeset View
Changeset View
Standalone View
Standalone View
kcmodule/activities/activitywidget.cpp
Context not available. | |||||
24 | 24 | | |||
---|---|---|---|---|---|
25 | #include "../daemon/actions/bundled/suspendsession.h" | 25 | #include "../daemon/actions/bundled/suspendsession.h" | ||
26 | 26 | | |||
27 | #include "powerdevilpowermanagement.h" | ||||
28 | | ||||
27 | #include <KConfigGroup> | 29 | #include <KConfigGroup> | ||
28 | #include <KActivities/Consumer> | 30 | #include <KActivities/Consumer> | ||
29 | #include <Solid/PowerManagement> | | |||
30 | #include <Solid/Battery> | 31 | #include <Solid/Battery> | ||
31 | #include <Solid/Device> | 32 | #include <Solid/Device> | ||
32 | #include <actioneditwidget.h> | 33 | #include <actioneditwidget.h> | ||
Context not available. | |||||
91 | 92 | | |||
92 | using namespace PowerDevil::BundledActions; | 93 | using namespace PowerDevil::BundledActions; | ||
93 | 94 | | |||
94 | QSet< Solid::PowerManagement::SleepState > methods = Solid::PowerManagement::supportedSleepStates(); | 95 | if (PowerDevil::PowerManagement::instance()->canSuspend()) { | ||
95 | | ||||
96 | if (methods.contains(Solid::PowerManagement::SuspendState)) { | | |||
97 | m_ui->alwaysActionBox->addItem(QIcon::fromTheme("system-suspend"), | 96 | m_ui->alwaysActionBox->addItem(QIcon::fromTheme("system-suspend"), | ||
98 | i18n("Suspend"), (uint)SuspendSession::ToRamMode); | 97 | i18n("Suspend"), (uint)SuspendSession::ToRamMode); | ||
99 | } | 98 | } | ||
100 | if (methods.contains(Solid::PowerManagement::HibernateState)) { | 99 | if (PowerDevil::PowerManagement::instance()->canHibernate()) { | ||
101 | m_ui->alwaysActionBox->addItem(QIcon::fromTheme("system-suspend-hibernate"), | 100 | m_ui->alwaysActionBox->addItem(QIcon::fromTheme("system-suspend-hibernate"), | ||
102 | i18n("Hibernate"), (uint)SuspendSession::ToDiskMode); | 101 | i18n("Hibernate"), (uint)SuspendSession::ToDiskMode); | ||
103 | } | 102 | } | ||
Context not available. |