From 0aecff2095894b0d47e9736ef639a133f8f08f6c Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Sun, 17 Jan 2021 17:31:49 +0100 Subject: [PATCH] [Notifications] Don't sort stopped jobs differently While this was in principle a good idea to keep active jobs at the top of the history, it can cause unwanted dialog shifts and dialog recreation when there are two jobs and the first one finishes and then the second one finishes. --- libnotificationmanager/notificationsortproxymodel.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/libnotificationmanager/notificationsortproxymodel.cpp b/libnotificationmanager/notificationsortproxymodel.cpp index fe66bbe41..9dbd6a6b3 100644 --- a/libnotificationmanager/notificationsortproxymodel.cpp +++ b/libnotificationmanager/notificationsortproxymodel.cpp @@ -71,15 +71,8 @@ int sortScore(const QModelIndex &idx) return 3; } - const int type = idx.data(Notifications::TypeRole).toInt(); - if (type == Notifications::JobType) { - const int jobState = idx.data(Notifications::JobStateRole).toInt(); - // Treat finished jobs as normal notifications but running jobs more important - if (jobState == Notifications::JobStateStopped) { - return 1; - } else { - return 2; - } + if (idx.data(Notifications::TypeRole).toInt() == Notifications::JobType) { + return 2; } if (urgency == Notifications::NormalUrgency) {