Module: deluge Branch: master Commit: 238e183851b3be492b99f9ed84bd69257782066c
Author: Pedro Algarvio <[email protected]> Date: Mon Mar 8 02:52:09 2010 +0000 Cleaned up the `seed_peer_column_sort` function. Code reuse is always better. --- deluge/ui/gtkui/torrentview.py | 15 ++++----------- 1 files changed, 4 insertions(+), 11 deletions(-) diff --git a/deluge/ui/gtkui/torrentview.py b/deluge/ui/gtkui/torrentview.py index 2af62ef..e36dc1c 100644 --- a/deluge/ui/gtkui/torrentview.py +++ b/deluge/ui/gtkui/torrentview.py @@ -157,17 +157,10 @@ def seed_peer_column_sort(model, iter1, iter2, data): if v2 == v4: return 0 if v2 > v4: - return -1 - if v2 < v4: return 1 - if v1 == 0: - return 1 - if v3 == 0: - return -1 - if v1 > v3: - return 1 - if v3 > v1: - return -1 + if v2 < v4: + return -1 + return queue_column_sort(model, iter1, iter2, data) class TorrentView(listview.ListView, component.Component): """TorrentView handles the listing of torrents.""" @@ -182,7 +175,7 @@ class TorrentView(listview.ListView, component.Component): # If we have gotten the state yet self.got_state = False - + # This is where status updates are put self.status = {} -- You received this message because you are subscribed to the Google Groups "deluge-commit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/deluge-commit?hl=en.
