Changeset View
Changeset View
Standalone View
Standalone View
src/notifybypopup.cpp
Show First 20 Lines • Show All 706 Lines • ▼ Show 20 Line(s) | 621 | { | |||
---|---|---|---|---|---|
707 | if (!(notification->flags() & KNotification::Persistent)) { | 707 | if (!(notification->flags() & KNotification::Persistent)) { | ||
708 | hintsMap[QStringLiteral("transient")] = true; | 708 | hintsMap[QStringLiteral("transient")] = true; | ||
709 | } | 709 | } | ||
710 | 710 | | |||
711 | if (!qApp->desktopFileName().isEmpty()) { | 711 | if (!qApp->desktopFileName().isEmpty()) { | ||
712 | hintsMap[QStringLiteral("desktop-entry")] = qApp->desktopFileName(); | 712 | hintsMap[QStringLiteral("desktop-entry")] = qApp->desktopFileName(); | ||
713 | } | 713 | } | ||
714 | 714 | | |||
715 | if (notification->urgency() != KNotification::DefaultUrgency) { | 715 | int urgency = -1; | ||
716 | hintsMap[QStringLiteral("urgency")] = static_cast<int>(notification->urgency()); | 716 | switch (notification->urgency()) { | ||
717 | case KNotification::DefaultUrgency: | ||||
718 | break; | ||||
719 | case KNotification::LowUrgency: | ||||
720 | urgency = 0; | ||||
721 | break; | ||||
722 | case KNotification::NormalUrgency: | ||||
723 | Q_FALLTHROUGH(); | ||||
724 | // galago notifications only know low, normal, critical | ||||
725 | case KNotification::HighUrgency: | ||||
726 | urgency = 1; | ||||
727 | break; | ||||
728 | case KNotification::CriticalUrgency: | ||||
729 | urgency = 2; | ||||
730 | break; | ||||
731 | } | ||||
732 | | ||||
733 | if (urgency > -1) { | ||||
734 | hintsMap[QStringLiteral("urgency")] = urgency; | ||||
717 | } | 735 | } | ||
718 | 736 | | |||
719 | const QVariantMap hints = notification->hints(); | 737 | const QVariantMap hints = notification->hints(); | ||
720 | for (auto it = hints.constBegin(); it != hints.constEnd(); ++it) { | 738 | for (auto it = hints.constBegin(); it != hints.constEnd(); ++it) { | ||
721 | hintsMap[it.key()] = it.value(); | 739 | hintsMap[it.key()] = it.value(); | ||
722 | } | 740 | } | ||
723 | 741 | | |||
724 | //FIXME - reenable/fix | 742 | //FIXME - reenable/fix | ||
▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines |