Changeset View
Changeset View
Standalone View
Standalone View
src/notifybypopup.cpp
Show First 20 Lines • Show All 471 Lines • ▼ Show 20 Line(s) | |||||
472 | { | 472 | { | ||
473 | auto iter = d->galagoNotifications.find(notificationId); | 473 | auto iter = d->galagoNotifications.find(notificationId); | ||
474 | if (iter == d->galagoNotifications.end()) { | 474 | if (iter == d->galagoNotifications.end()) { | ||
475 | return; | 475 | return; | ||
476 | } | 476 | } | ||
477 | 477 | | |||
478 | KNotification *n = *iter; | 478 | KNotification *n = *iter; | ||
479 | if (n) { | 479 | if (n) { | ||
480 | if (actionKey == "default") { | ||||
481 | emit actionInvoked(n->id(), 0); | ||||
482 | } else { | ||||
480 | emit actionInvoked(n->id(), actionKey.toUInt()); | 483 | emit actionInvoked(n->id(), actionKey.toUInt()); | ||
484 | } | ||||
481 | } else { | 485 | } else { | ||
482 | d->galagoNotifications.erase(iter); | 486 | d->galagoNotifications.erase(iter); | ||
483 | } | 487 | } | ||
484 | } | 488 | } | ||
485 | 489 | | |||
486 | void NotifyByPopup::onGalagoNotificationClosed(uint dbus_id, uint reason) | 490 | void NotifyByPopup::onGalagoNotificationClosed(uint dbus_id, uint reason) | ||
487 | { | 491 | { | ||
488 | auto iter = d->galagoNotifications.find(dbus_id); | 492 | auto iter = d->galagoNotifications.find(dbus_id); | ||
▲ Show 20 Lines • Show All 173 Lines • ▼ Show 20 Line(s) | 624 | { | |||
662 | 666 | | |||
663 | // galago spec defines action list to be list like | 667 | // galago spec defines action list to be list like | ||
664 | // (act_id1, action1, act_id2, action2, ...) | 668 | // (act_id1, action1, act_id2, action2, ...) | ||
665 | // | 669 | // | ||
666 | // assign id's to actions like it's done in fillPopup() method | 670 | // assign id's to actions like it's done in fillPopup() method | ||
667 | // (i.e. starting from 1) | 671 | // (i.e. starting from 1) | ||
668 | QStringList actionList; | 672 | QStringList actionList; | ||
669 | if (popupServerCapabilities.contains(QStringLiteral("actions"))) { | 673 | if (popupServerCapabilities.contains(QStringLiteral("actions"))) { | ||
674 | QString defaultAction = notification->defaultAction(); | ||||
675 | if (!defaultAction.isEmpty()) { | ||||
676 | actionList.append("default"); | ||||
677 | actionList.append(defaultAction); | ||||
678 | } | ||||
670 | int actId = 0; | 679 | int actId = 0; | ||
671 | Q_FOREACH (const QString &actionName, notification->actions()) { | 680 | Q_FOREACH (const QString &actionName, notification->actions()) { | ||
672 | actId++; | 681 | actId++; | ||
673 | actionList.append(QString::number(actId)); | 682 | actionList.append(QString::number(actId)); | ||
674 | actionList.append(actionName); | 683 | actionList.append(actionName); | ||
675 | } | 684 | } | ||
676 | } | 685 | } | ||
677 | 686 | | |||
▲ Show 20 Lines • Show All 151 Lines • Show Last 20 Lines |