Commit d7118124 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[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
parent b8739e15
...@@ -99,15 +99,8 @@ bool NotificationSortProxyModel::lessThan(const QModelIndex &source_left, const ...@@ -99,15 +99,8 @@ bool NotificationSortProxyModel::lessThan(const QModelIndex &source_left, const
} }
if (scoreLeft == scoreRight) { if (scoreLeft == scoreRight) {
QDateTime timeLeft = source_left.data(Notifications::UpdatedRole).toDateTime(); const QDateTime timeLeft = source_left.data(Notifications::CreatedRole).toDateTime();
if (!timeLeft.isValid()) { const QDateTime timeRight = source_right.data(Notifications::CreatedRole).toDateTime();
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();
}
// sorts descending by time (newest first) // sorts descending by time (newest first)
return timeLeft > timeRight; return timeLeft > timeRight;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment