Improve performance of initial torrent list load
This commit is contained in:
parent
f4302c95ef
commit
8bebfc918e
|
@ -188,7 +188,7 @@ class TorrentView(listview.ListView, component.Component):
|
||||||
|
|
||||||
def _on_session_state(self, state):
|
def _on_session_state(self, state):
|
||||||
for torrent_id in state:
|
for torrent_id in state:
|
||||||
self.add_row(torrent_id)
|
self.add_row(torrent_id, update=False)
|
||||||
|
|
||||||
self.update_filter()
|
self.update_filter()
|
||||||
self.update()
|
self.update()
|
||||||
|
@ -343,7 +343,7 @@ class TorrentView(listview.ListView, component.Component):
|
||||||
if self.status != {}:
|
if self.status != {}:
|
||||||
self.update_view()
|
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"""
|
"""Adds a new torrent row to the treeview"""
|
||||||
# Insert a new row to the liststore
|
# Insert a new row to the liststore
|
||||||
row = self.liststore.append()
|
row = self.liststore.append()
|
||||||
|
@ -352,6 +352,7 @@ class TorrentView(listview.ListView, component.Component):
|
||||||
row,
|
row,
|
||||||
self.columns["torrent_id"].column_indices[0],
|
self.columns["torrent_id"].column_indices[0],
|
||||||
torrent_id)
|
torrent_id)
|
||||||
|
if update:
|
||||||
self.update()
|
self.update()
|
||||||
self.update_filter()
|
self.update_filter()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue