mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 04:54:18 +00:00
parent
216778be64
commit
323de569df
@ -57,6 +57,16 @@ protected:
|
||||
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user