mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-28 13:28:50 +03:00
Reuse existing code for sorting
This makes the behavior of sorting by TR_SEED_DATE consistent.
This commit is contained in:
parent
dc39b9e643
commit
45874fa333
1 changed files with 1 additions and 21 deletions
|
@ -166,27 +166,7 @@ bool TransferListSortModel::lessThan_impl(const QModelIndex &left, const QModelI
|
||||||
return positionL != 0;
|
return positionL != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort according to TR_SEED_DATE
|
return invokeLessThanForColumn(TransferListModel::TR_SEED_DATE);
|
||||||
const auto dateL = left.sibling(left.row(), TransferListModel::TR_SEED_DATE)
|
|
||||||
.data(TransferListModel::UnderlyingDataRole).toDateTime();
|
|
||||||
const auto dateR = right.sibling(right.row(), TransferListModel::TR_SEED_DATE)
|
|
||||||
.data(TransferListModel::UnderlyingDataRole).toDateTime();
|
|
||||||
|
|
||||||
if (dateL.isValid() && dateR.isValid())
|
|
||||||
{
|
|
||||||
if (dateL != dateR)
|
|
||||||
return dateL < dateR;
|
|
||||||
}
|
|
||||||
else if (dateL.isValid())
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else if (dateR.isValid())
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return hashLessThan();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case TransferListModel::TR_SEEDS:
|
case TransferListModel::TR_SEEDS:
|
||||||
|
|
Loading…
Reference in a new issue