Improve performance of initial torrent list load

This commit is contained in:
Andrew Resch 2008-08-15 03:50:25 +00:00
parent 61b9e4ae0e
commit a118d3e7d5
2 changed files with 6 additions and 4 deletions

View file

@ -3,6 +3,7 @@ Deluge 0.9.07 - "1.0.0_RC7" (In Development)
* Fix Vista slowness issue
GtkUI:
* Add 'edit' to edit trackers dialog
* Improve performance of initial torrent list load
Deluge 0.9.06 - "1.0.0_RC6" (13 August 2008)
Core:

View file

@ -205,7 +205,7 @@ class TorrentView(listview.ListView, component.Component):
def _on_session_state(self, state):
for torrent_id in state:
self.add_row(torrent_id)
self.add_row(torrent_id, update=False)
self.update_filter()
self.update()
@ -360,7 +360,7 @@ class TorrentView(listview.ListView, component.Component):
if self.status != {}:
self.update_view()
def add_row(self, torrent_id):
def add_row(self, torrent_id, update=True):
"""Adds a new torrent row to the treeview"""
# Insert a new row to the liststore
row = self.liststore.append()
@ -369,8 +369,9 @@ class TorrentView(listview.ListView, component.Component):
row,
self.columns["torrent_id"].column_indices[0],
torrent_id)
self.update()
self.update_filter()
if update:
self.update()
self.update_filter()
def remove_row(self, torrent_id):
"""Removes a row with torrent_id"""