mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 05:43:32 -07:00
parent
3afd01d617
commit
af29f6a42b
1 changed files with 10 additions and 0 deletions
|
@ -57,6 +57,16 @@ protected:
|
||||||
|
|
||||||
return QSortFilterProxyModel::lessThan(left, right);
|
return QSortFilterProxyModel::lessThan(left, right);
|
||||||
}
|
}
|
||||||
|
else if (sortColumn() == TorrentModelItem::TR_ADD_DATE || sortColumn() == TorrentModelItem::TR_SEED_DATE) {
|
||||||
|
QDateTime vL = sourceModel()->data(left).toDateTime();
|
||||||
|
QDateTime vR = sourceModel()->data(right).toDateTime();
|
||||||
|
|
||||||
|
//not valid dates should be sorted at the bottom.
|
||||||
|
if (!vL.isValid()) return !(sortOrder() == Qt::AscendingOrder);
|
||||||
|
if (!vR.isValid()) return (sortOrder() == Qt::AscendingOrder);
|
||||||
|
|
||||||
|
return vL < vR;
|
||||||
|
}
|
||||||
return QSortFilterProxyModel::lessThan(left, right);
|
return QSortFilterProxyModel::lessThan(left, right);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue