mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-10-22 10:46:04 +03:00
Fix queue sorting order fixes #1120
This commit is contained in:
parent
33b0a2b55f
commit
85cfe464f9
1 changed files with 19 additions and 9 deletions
|
@ -66,7 +66,17 @@ protected:
|
||||||
if (!vR.isValid()) return true;
|
if (!vR.isValid()) return true;
|
||||||
|
|
||||||
return vL < vR;
|
return vL < vR;
|
||||||
} else if (sortColumn() == TorrentModelItem::TR_PEERS || sortColumn() == TorrentModelItem::TR_SEEDS) {
|
}
|
||||||
|
else if (sortColumn() == TorrentModelItem::TR_PRIORITY) {
|
||||||
|
int vL = sourceModel()->data(left).toInt();
|
||||||
|
int vR = sourceModel()->data(right).toInt();
|
||||||
|
|
||||||
|
//finished torrents should be last
|
||||||
|
if (vL == -1) return false;
|
||||||
|
if (vR == -1) return true;
|
||||||
|
return vL < vR;
|
||||||
|
}
|
||||||
|
else if (sortColumn() == TorrentModelItem::TR_PEERS || sortColumn() == TorrentModelItem::TR_SEEDS) {
|
||||||
int left_active = sourceModel()->data(left).toInt();
|
int left_active = sourceModel()->data(left).toInt();
|
||||||
int left_total = sourceModel()->data(left, Qt::UserRole).toInt();
|
int left_total = sourceModel()->data(left, Qt::UserRole).toInt();
|
||||||
int right_active = sourceModel()->data(right).toInt();
|
int right_active = sourceModel()->data(right).toInt();
|
||||||
|
|
Loading…
Reference in a new issue