From 0a51b57a548f29d416c26b70eca3be7cdbe542c6 Mon Sep 17 00:00:00 2001 From: Gabriele Date: Sun, 5 Apr 2015 20:00:00 +0100 Subject: [PATCH] Put torrents with invalid "Last Activity" value at the bottom of the list Closes #2809. --- src/gui/transferlistsortmodel.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/transferlistsortmodel.cpp b/src/gui/transferlistsortmodel.cpp index e54f7ebb7..77957ca6f 100644 --- a/src/gui/transferlistsortmodel.cpp +++ b/src/gui/transferlistsortmodel.cpp @@ -218,6 +218,15 @@ bool TransferListSortModel::lessThan(const QModelIndex &left, const QModelIndex return !invalidL; } } + else if (column == TorrentModelItem::TR_LAST_ACTIVITY) { + const qlonglong vL = left.data().toLongLong(); + const qlonglong vR = right.data().toLongLong(); + + if (vL == -1) return false; + if (vR == -1) return true; + + return vL < vR; + } return QSortFilterProxyModel::lessThan(left, right); }