Changeset View
Changeset View
Standalone View
Standalone View
runners/activities/activityrunner.cpp
Show First 20 Lines • Show All 152 Lines • ▼ Show 20 Line(s) | 84 | { | |||
---|---|---|---|---|---|
153 | context.addMatches(matches); | 153 | context.addMatches(matches); | ||
154 | } | 154 | } | ||
155 | 155 | | |||
156 | void ActivityRunner::addMatch(const KActivities::Info &activity, QList<Plasma::QueryMatch> &matches) | 156 | void ActivityRunner::addMatch(const KActivities::Info &activity, QList<Plasma::QueryMatch> &matches) | ||
157 | { | 157 | { | ||
158 | Plasma::QueryMatch match(this); | 158 | Plasma::QueryMatch match(this); | ||
159 | match.setData(activity.id()); | 159 | match.setData(activity.id()); | ||
160 | match.setType(Plasma::QueryMatch::ExactMatch); | 160 | match.setType(Plasma::QueryMatch::ExactMatch); | ||
161 | match.setIconName(activity.icon().isEmpty() ? QStringLiteral("preferences-activities") : activity.icon()); | 161 | match.setIconName(activity.icon().isEmpty() ? QStringLiteral("activities") : activity.icon()); | ||
162 | match.setText(i18n("Switch to \"%1\"", activity.name())); | 162 | match.setText(i18n("Switch to \"%1\"", activity.name())); | ||
163 | match.setRelevance(0.7 + ((activity.state() == KActivities::Info::Running || | 163 | match.setRelevance(0.7 + ((activity.state() == KActivities::Info::Running || | ||
164 | activity.state() == KActivities::Info::Starting) ? 0.1 : 0)); | 164 | activity.state() == KActivities::Info::Starting) ? 0.1 : 0)); | ||
165 | matches << match; | 165 | matches << match; | ||
166 | } | 166 | } | ||
167 | 167 | | |||
168 | void ActivityRunner::run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) | 168 | void ActivityRunner::run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) | ||
169 | { | 169 | { | ||
Show All 10 Lines |