Changeset View
Changeset View
Standalone View
Standalone View
runners/sessions/sessionrunner.cpp
Show All 36 Lines | 35 | { | |||
---|---|---|---|---|---|
37 | setPriority(LowPriority); | 37 | setPriority(LowPriority); | ||
38 | setIgnoredTypes(Plasma::RunnerContext::Directory | Plasma::RunnerContext::File | | 38 | setIgnoredTypes(Plasma::RunnerContext::Directory | Plasma::RunnerContext::File | | ||
39 | Plasma::RunnerContext::NetworkLocation); | 39 | Plasma::RunnerContext::NetworkLocation); | ||
40 | 40 | | |||
41 | m_canLogout = KAuthorized::authorizeAction(QStringLiteral("logout")) && KAuthorized::authorize(QStringLiteral("logout")); | 41 | m_canLogout = KAuthorized::authorizeAction(QStringLiteral("logout")) && KAuthorized::authorize(QStringLiteral("logout")); | ||
42 | if (m_canLogout) { | 42 | if (m_canLogout) { | ||
43 | addSyntax(Plasma::RunnerSyntax(i18nc("log out command", "logout"), | 43 | addSyntax(Plasma::RunnerSyntax(i18nc("log out command", "logout"), | ||
44 | i18n("Logs out, exiting the current desktop session"))); | 44 | i18n("Logs out, exiting the current desktop session"))); | ||
45 | addSyntax(Plasma::RunnerSyntax(i18nc("shutdown computer command", "shutdown"), | 45 | addSyntax(Plasma::RunnerSyntax(i18nc("shut down computer command", "shut down"), | ||
46 | i18n("Turns off the computer"))); | 46 | i18n("Turns off the computer"))); | ||
47 | } | 47 | } | ||
48 | 48 | | |||
49 | if (KAuthorized::authorizeAction(QStringLiteral("lock_screen")) && m_canLogout) { | 49 | if (KAuthorized::authorizeAction(QStringLiteral("lock_screen")) && m_canLogout) { | ||
50 | addSyntax(Plasma::RunnerSyntax(i18nc("lock screen command", "lock"), | 50 | addSyntax(Plasma::RunnerSyntax(i18nc("lock screen command", "lock"), | ||
51 | i18n("Locks the current sessions and starts the screen saver"))); | 51 | i18n("Locks the current sessions and starts the screen saver"))); | ||
52 | } | 52 | } | ||
53 | 53 | | |||
Show All 39 Lines | 92 | } else if (term.compare(i18nc("restart computer command", "restart"), Qt::CaseInsensitive) == 0 || | |||
93 | term.compare(i18nc("restart computer command", "reboot"), Qt::CaseInsensitive) == 0) { | 93 | term.compare(i18nc("restart computer command", "reboot"), Qt::CaseInsensitive) == 0) { | ||
94 | Plasma::QueryMatch match(this); | 94 | Plasma::QueryMatch match(this); | ||
95 | match.setText(i18n("Restart the computer")); | 95 | match.setText(i18n("Restart the computer")); | ||
96 | match.setIconName(QStringLiteral("system-reboot")); | 96 | match.setIconName(QStringLiteral("system-reboot")); | ||
97 | match.setData(RestartAction); | 97 | match.setData(RestartAction); | ||
98 | match.setType(Plasma::QueryMatch::ExactMatch); | 98 | match.setType(Plasma::QueryMatch::ExactMatch); | ||
99 | match.setRelevance(0.9); | 99 | match.setRelevance(0.9); | ||
100 | matches << match; | 100 | matches << match; | ||
101 | } else if (term.compare(i18nc("shutdown computer command","shutdown"), Qt::CaseInsensitive) == 0) { | 101 | } else if (term.compare(i18nc("shut down computer command","shut down"), Qt::CaseInsensitive) == 0 || | ||
102 | term.compare(i18nc("shut down computer command", "shutdown"), Qt::CaseInsensitive) == 0) { | ||||
102 | Plasma::QueryMatch match(this); | 103 | Plasma::QueryMatch match(this); | ||
103 | match.setText(i18n("Shutdown the computer")); | 104 | match.setText(i18n("Shut down the computer")); | ||
104 | match.setIconName(QStringLiteral("system-shutdown")); | 105 | match.setIconName(QStringLiteral("system-shutdown")); | ||
105 | match.setData(ShutdownAction); | 106 | match.setData(ShutdownAction); | ||
106 | match.setType(Plasma::QueryMatch::ExactMatch); | 107 | match.setType(Plasma::QueryMatch::ExactMatch); | ||
107 | match.setRelevance(0.9); | 108 | match.setRelevance(0.9); | ||
108 | matches << match; | 109 | matches << match; | ||
109 | } else if (term.compare(i18nc("lock screen command","lock"), Qt::CaseInsensitive) == 0) { | 110 | } else if (term.compare(i18nc("lock screen command","lock"), Qt::CaseInsensitive) == 0) { | ||
110 | if (KAuthorized::authorizeAction(QStringLiteral("lock_screen"))) { | 111 | if (KAuthorized::authorizeAction(QStringLiteral("lock_screen"))) { | ||
111 | Plasma::QueryMatch match(this); | 112 | Plasma::QueryMatch match(this); | ||
▲ Show 20 Lines • Show All 168 Lines • Show Last 20 Lines |