From f02db79c526ed19db21ec4e447f9cdee671fbb01 Mon Sep 17 00:00:00 2001 From: Gabriele Date: Sun, 5 Apr 2015 20:00:00 +0100 Subject: [PATCH] Put torrents with no ratio limit at the bottom --- src/gui/transferlistsortmodel.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/transferlistsortmodel.cpp b/src/gui/transferlistsortmodel.cpp index 77957ca6f..3e9af1121 100644 --- a/src/gui/transferlistsortmodel.cpp +++ b/src/gui/transferlistsortmodel.cpp @@ -227,6 +227,15 @@ bool TransferListSortModel::lessThan(const QModelIndex &left, const QModelIndex return vL < vR; } + else if (column == TorrentModelItem::TR_RATIO_LIMIT) { + const qreal vL = left.data().toDouble(); + const qreal vR = right.data().toDouble(); + + if (vL == -1) return false; + if (vR == -1) return true; + + return vL < vR; + } return QSortFilterProxyModel::lessThan(left, right); }