mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
Merge pull request #9346 from Chocobo1/lastact
Fix values sorted wrong in "Last Activity" column
This commit is contained in:
commit
ee57b68901
@ -183,23 +183,23 @@ bool TransferListSortModel::lessThan(const QModelIndex &left, const QModelIndex
|
|||||||
}
|
}
|
||||||
|
|
||||||
case TransferListModel::TR_LAST_ACTIVITY: {
|
case TransferListModel::TR_LAST_ACTIVITY: {
|
||||||
const qlonglong vL = left.data().toLongLong();
|
const int vL = left.data().toInt();
|
||||||
const qlonglong vR = right.data().toLongLong();
|
const int vR = right.data().toInt();
|
||||||
|
|
||||||
if (vL == -1) return false;
|
if (vL < 0) return false;
|
||||||
if (vR == -1) return true;
|
if (vR < 0) return true;
|
||||||
|
|
||||||
return vL < vR;
|
return (vL < vR);
|
||||||
}
|
}
|
||||||
|
|
||||||
case TransferListModel::TR_RATIO_LIMIT: {
|
case TransferListModel::TR_RATIO_LIMIT: {
|
||||||
const qreal vL = left.data().toDouble();
|
const qreal vL = left.data().toReal();
|
||||||
const qreal vR = right.data().toDouble();
|
const qreal vR = right.data().toReal();
|
||||||
|
|
||||||
if (vL == -1) return false;
|
if (vL < 0) return false;
|
||||||
if (vR == -1) return true;
|
if (vR < 0) return true;
|
||||||
|
|
||||||
return vL < vR;
|
return (vL < vR);
|
||||||
}
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
|
Loading…
Reference in New Issue
Block a user