From 81a33da08dccf6300c5ec027d3e57760fb9a02be Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 8 Jun 2017 12:05:33 +0200 Subject: Stable sorting even if the dates are the same. --- framework/src/domain/maillistmodel.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'framework/src/domain') diff --git a/framework/src/domain/maillistmodel.cpp b/framework/src/domain/maillistmodel.cpp index b3f6f56b..97c37384 100644 --- a/framework/src/domain/maillistmodel.cpp +++ b/framework/src/domain/maillistmodel.cpp @@ -167,6 +167,10 @@ bool MailListModel::lessThan(const QModelIndex &left, const QModelIndex &right) { const auto leftDate = left.data(Sink::Store::DomainObjectRole).value()->getDate(); const auto rightDate = right.data(Sink::Store::DomainObjectRole).value()->getDate(); + if (leftDate == rightDate) { + return left.data(Sink::Store::DomainObjectRole).value()->identifier() < + right.data(Sink::Store::DomainObjectRole).value()->identifier(); + } return leftDate < rightDate; } -- cgit v1.2.3