From 2be303e51a515bc7126521079e9ad26386aa677b Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 21 Jun 2016 14:32:46 +0200 Subject: Fixed mailsorting by date --- framework/domain/maillistmodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'framework/domain/maillistmodel.cpp') diff --git a/framework/domain/maillistmodel.cpp b/framework/domain/maillistmodel.cpp index 4ea7075c..e3f555c4 100644 --- a/framework/domain/maillistmodel.cpp +++ b/framework/domain/maillistmodel.cpp @@ -86,9 +86,9 @@ QVariant MailListModel::data(const QModelIndex &idx, int role) const bool MailListModel::lessThan(const QModelIndex &left, const QModelIndex &right) const { - const QVariant leftData = left.sibling(left.row(), Date).data(Qt::DisplayRole); - const QVariant rightData = right.sibling(right.row(), Date).data(Qt::DisplayRole); - return leftData.toDateTime() < rightData.toDateTime(); + const auto leftDate = left.data(Sink::Store::DomainObjectRole).value()->getDate(); + const auto rightDate = right.data(Sink::Store::DomainObjectRole).value()->getDate(); + return leftDate < rightDate; } void MailListModel::runQuery(const Sink::Query &query) -- cgit v1.2.3