normalize urgency in freedesktop backend

This commit is contained in:
Patrick von Reth 2015-06-29 12:08:23 +02:00
parent b530d7771c
commit c004504a9d
1 changed files with 8 additions and 4 deletions

View File

@ -61,9 +61,13 @@ void FreedesktopBackend::slotNotify(Notification noti)
hints["image_data"] = QVariant::fromValue(image); hints["image_data"] = QVariant::fromValue(image);
} }
if (noti.priority() != Notification::NORMAL) { char urgency = '1'
hints["urgency"] = (char)noti.priority() + 1; if(noti.priority() < 0){
urgency = '0';
} else if(noti.priority() > 2) {
urgency = '2';
} }
hints["urgency"] = urgency;
if (noti.application().constHints().contains("desktop-entry")) { if (noti.application().constHints().contains("desktop-entry")) {
hints["desktop-entry"] = noti.application().constHints().value("desktop-entry"); hints["desktop-entry"] = noti.application().constHints().value("desktop-entry");