[Notifications] Don't take updated time into account for sorting

Notification spec says, when replacing a notification:

> The server must atomically (ie with no flicker or other visual cues) replace the given notification with this one.

Notifications shifting about is a "visual cue".

Differential Revision: https://phabricator.kde.org/D29771
wilder-portage-prov
Kai Uwe Broulik 6 years ago
parent b8739e1522
commit d71181245f
  1. 11
      libnotificationmanager/notificationsortproxymodel.cpp

@ -99,15 +99,8 @@ bool NotificationSortProxyModel::lessThan(const QModelIndex &source_left, const
}
if (scoreLeft == scoreRight) {
QDateTime timeLeft = source_left.data(Notifications::UpdatedRole).toDateTime();
if (!timeLeft.isValid()) {
timeLeft = source_left.data(Notifications::CreatedRole).toDateTime();
}
QDateTime timeRight = source_right.data(Notifications::UpdatedRole).toDateTime();
if (!timeRight.isValid()) {
timeRight = source_right.data(Notifications::CreatedRole).toDateTime();
}
const QDateTime timeLeft = source_left.data(Notifications::CreatedRole).toDateTime();
const QDateTime timeRight = source_right.data(Notifications::CreatedRole).toDateTime();
// sorts descending by time (newest first)
return timeLeft > timeRight;

Loading…
Cancel
Save