|
|
|
@ -66,7 +66,17 @@ protected:
@@ -66,7 +66,17 @@ protected:
|
|
|
|
|
if (!vR.isValid()) return true; |
|
|
|
|
|
|
|
|
|
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_total = sourceModel()->data(left, Qt::UserRole).toInt(); |
|
|
|
|
int right_active = sourceModel()->data(right).toInt(); |
|
|
|
|