Changeset View
Changeset View
Standalone View
Standalone View
src/notifybyportal.cpp
Show First 20 Lines • Show All 253 Lines • ▼ Show 20 Line(s) | 239 | { | |||
---|---|---|---|---|---|
254 | //did the user override the icon name? | 254 | //did the user override the icon name? | ||
255 | if (!notification->iconName().isEmpty()) { | 255 | if (!notification->iconName().isEmpty()) { | ||
256 | iconName = notification->iconName(); | 256 | iconName = notification->iconName(); | ||
257 | } | 257 | } | ||
258 | 258 | | |||
259 | QString title = notification->title().isEmpty() ? appCaption : notification->title(); | 259 | QString title = notification->title().isEmpty() ? appCaption : notification->title(); | ||
260 | QString text = notification->text(); | 260 | QString text = notification->text(); | ||
261 | 261 | | |||
262 | if (!notification->defaultAction().isEmpty()) { | ||||
263 | portalArgs.insert(QStringLiteral("default-action"), notification->defaultAction()); | ||||
264 | portalArgs.insert(QStringLiteral("default-action-target"), QStringLiteral("0")); | ||||
265 | } | ||||
266 | | ||||
267 | QString priority; | ||||
268 | switch (notification->urgency()) { | ||||
269 | case KNotification::DefaultUrgency: | ||||
270 | break; | ||||
271 | case KNotification::LowUrgency: | ||||
272 | priority = QStringLiteral("low"); | ||||
273 | break; | ||||
274 | case KNotification::NormalUrgency: | ||||
275 | priority = QStringLiteral("normal"); | ||||
276 | break; | ||||
277 | case KNotification::HighUrgency: | ||||
278 | priority = QStringLiteral("high"); | ||||
279 | break; | ||||
280 | case KNotification::CriticalUrgency: | ||||
281 | priority = QStringLiteral("urgent"); | ||||
282 | break; | ||||
283 | } | ||||
284 | | ||||
285 | if (!priority.isEmpty()) { | ||||
286 | portalArgs.insert(QStringLiteral("priority"), priority); | ||||
287 | } | ||||
288 | | ||||
262 | // galago spec defines action list to be list like | 289 | // galago spec defines action list to be list like | ||
263 | // (act_id1, action1, act_id2, action2, ...) | 290 | // (act_id1, action1, act_id2, action2, ...) | ||
264 | // | 291 | // | ||
265 | // assign id's to actions like it's done in fillPopup() method | 292 | // assign id's to actions like it's done in fillPopup() method | ||
266 | // (i.e. starting from 1) | 293 | // (i.e. starting from 1) | ||
267 | QList<QVariantMap> buttons; | 294 | QList<QVariantMap> buttons; | ||
268 | buttons.reserve(notification->actions().count()); | 295 | buttons.reserve(notification->actions().count()); | ||
269 | 296 | | |||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |