Changeset View
Changeset View
Standalone View
Standalone View
applets/kicker/plugin/systementry.cpp
Show All 26 Lines | |||||
27 | #include <KConfigGroup> | 27 | #include <KConfigGroup> | ||
28 | #include <KLocalizedString> | 28 | #include <KLocalizedString> | ||
29 | #include <KSharedConfig> | 29 | #include <KSharedConfig> | ||
30 | #include <kworkspace.h> | 30 | #include <kworkspace.h> | ||
31 | #include <Solid/PowerManagement> | 31 | #include <Solid/PowerManagement> | ||
32 | #include "ksmserver_interface.h" | 32 | #include "ksmserver_interface.h" | ||
33 | #include <kworkspace5/kdisplaymanager.h> | 33 | #include <kworkspace5/kdisplaymanager.h> | ||
34 | 34 | | |||
35 | KDisplayManager *SystemEntry::m_displayManager = new KDisplayManager(); | | |||
36 | | ||||
37 | SystemEntry::SystemEntry(AbstractModel *owner, Action action) : AbstractEntry(owner) | 35 | SystemEntry::SystemEntry(AbstractModel *owner, Action action) : AbstractEntry(owner) | ||
38 | , m_action(action) | 36 | , m_action(action) | ||
39 | , m_valid(false) | 37 | , m_valid(false) | ||
40 | { | 38 | { | ||
41 | init(); | 39 | init(); | ||
42 | } | 40 | } | ||
43 | 41 | | |||
44 | SystemEntry::SystemEntry(AbstractModel *owner, const QString &id) : AbstractEntry(owner) | 42 | SystemEntry::SystemEntry(AbstractModel *owner, const QString &id) : AbstractEntry(owner) | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 78 | { | |||
87 | } else { | 85 | } else { | ||
88 | m_valid = authorize; | 86 | m_valid = authorize; | ||
89 | } | 87 | } | ||
90 | 88 | | |||
91 | break; | 89 | break; | ||
92 | } | 90 | } | ||
93 | case SwitchUser: | 91 | case SwitchUser: | ||
94 | m_valid = (KAuthorized::authorizeAction("start_new_session") || KAuthorized::authorizeAction("switch_user")) | 92 | m_valid = (KAuthorized::authorizeAction("start_new_session") || KAuthorized::authorizeAction("switch_user")) | ||
95 | && m_displayManager->isSwitchable(); | 93 | && KDisplayManager().isSwitchable(); | ||
96 | break; | 94 | break; | ||
97 | case SuspendToRam: | 95 | case SuspendToRam: | ||
98 | m_valid = Solid::PowerManagement::supportedSleepStates().contains(Solid::PowerManagement::SuspendState); | 96 | m_valid = Solid::PowerManagement::supportedSleepStates().contains(Solid::PowerManagement::SuspendState); | ||
99 | break; | 97 | break; | ||
100 | case SuspendToDisk: | 98 | case SuspendToDisk: | ||
101 | m_valid = Solid::PowerManagement::supportedSleepStates().contains(Solid::PowerManagement::HibernateState); | 99 | m_valid = Solid::PowerManagement::supportedSleepStates().contains(Solid::PowerManagement::HibernateState); | ||
102 | break; | 100 | break; | ||
103 | case Reboot: | 101 | case Reboot: | ||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |