Skip to content

Commit

Permalink
[lipstick] Use default event with notifications that don't have feedb…
Browse files Browse the repository at this point in the history
…ack hint. JB#51470
  • Loading branch information
jusa authored and adenexter committed Oct 14, 2020
1 parent 748f6b8 commit e59431b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/notifications/notificationfeedbackplayer.cpp
Expand Up @@ -64,9 +64,18 @@ void NotificationFeedbackPlayer::addNotification(uint id)

// Play the feedback related to the notification if any
const QString feedback = notification->hints().value(LipstickNotification::HINT_FEEDBACK).toString();
const QStringList feedbackItems = feedback.split(QStringLiteral(","), QString::SkipEmptyParts);
QStringList feedbackItems = feedback.split(QStringLiteral(","), QString::SkipEmptyParts);

if (isEnabled(notification, m_minimumPriority) && !feedbackItems.isEmpty()) {
int minimumPriority = m_minimumPriority;

if (feedbackItems.isEmpty() && isEnabled(notification, 0)) {
// Add generic feedback type
feedbackItems << "default";
// Play default feedback regardless of priorities
minimumPriority = 0;
}

if (isEnabled(notification, minimumPriority) && !feedbackItems.isEmpty()) {
QMap<QString, QVariant> properties;
if (notification->body().isEmpty() && notification->summary().isEmpty()) {
properties.insert("media.leds", false);
Expand Down

0 comments on commit e59431b

Please sign in to comment.