Cleaned up the `seed_peer_column_sort` function. Code reuse is always better.
This commit is contained in:
parent
8a15a18361
commit
238e183851
|
@ -157,17 +157,10 @@ def seed_peer_column_sort(model, iter1, iter2, data):
|
||||||
if v2 == v4:
|
if v2 == v4:
|
||||||
return 0
|
return 0
|
||||||
if v2 > v4:
|
if v2 > v4:
|
||||||
return -1
|
|
||||||
if v2 < v4:
|
|
||||||
return 1
|
return 1
|
||||||
if v1 == 0:
|
if v2 < v4:
|
||||||
return 1
|
return -1
|
||||||
if v3 == 0:
|
return queue_column_sort(model, iter1, iter2, data)
|
||||||
return -1
|
|
||||||
if v1 > v3:
|
|
||||||
return 1
|
|
||||||
if v3 > v1:
|
|
||||||
return -1
|
|
||||||
|
|
||||||
class TorrentView(listview.ListView, component.Component):
|
class TorrentView(listview.ListView, component.Component):
|
||||||
"""TorrentView handles the listing of torrents."""
|
"""TorrentView handles the listing of torrents."""
|
||||||
|
|
Loading…
Reference in New Issue