Fixed sort order for datetime columns with empty values (closes #2988)

A small fix belonging to #2531.
During the sorting empty QDateTime values are shuffled around due to
unstable sort in QSortFilterProxyModel (see #2526 and #2158), causing
the transfer list items to constantly change order.

Fixed by using an already existing correct comparison (with a torrent
hash fallback).
This commit is contained in:
Vladimir Sinenko
2015-05-19 22:10:57 +06:00
parent 2c1d76c87f
commit 56ee6dac08
2 changed files with 14 additions and 18 deletions

View File

@@ -51,6 +51,7 @@ public:
private:
bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
bool lowerPositionThan(const QModelIndex &left, const QModelIndex &right) const;
bool dateLessThan(const int dateColumn, const QModelIndex &left, const QModelIndex &right) const;
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
bool matchStatusFilter(int sourceRow, const QModelIndex &sourceParent) const;