From 8bebfc918e5d9f2191431578382c9234552b9c9e Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Fri, 15 Aug 2008 03:50:25 +0000 Subject: [PATCH] Improve performance of initial torrent list load --- deluge/ui/gtkui/torrentview.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/deluge/ui/gtkui/torrentview.py b/deluge/ui/gtkui/torrentview.py index 7e2ed9d39..539c1a12e 100644 --- a/deluge/ui/gtkui/torrentview.py +++ b/deluge/ui/gtkui/torrentview.py @@ -188,7 +188,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() @@ -343,7 +343,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() @@ -352,8 +352,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"""