mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-07 00:48:41 +00:00
Fix seeding torrents from moving around when sorting the '#' column
This commit is contained in:
parent
dc17647590
commit
5c839a6b20
2 changed files with 2 additions and 8 deletions
|
@ -161,23 +161,16 @@ class ListView:
|
||||||
"""create new filter-model
|
"""create new filter-model
|
||||||
must be called after listview.create_new_liststore
|
must be called after listview.create_new_liststore
|
||||||
"""
|
"""
|
||||||
sort_column = None
|
|
||||||
if self.model_filter:
|
|
||||||
# Save the liststore filter column
|
|
||||||
sort_column = self.model_filter.get_sort_column_id()
|
|
||||||
model_filter = self.liststore.filter_new()
|
model_filter = self.liststore.filter_new()
|
||||||
model_filter.set_visible_column(
|
model_filter.set_visible_column(
|
||||||
self.columns["filter"].column_indices[0])
|
self.columns["filter"].column_indices[0])
|
||||||
self.model_filter = gtk.TreeModelSort(model_filter)
|
self.model_filter = gtk.TreeModelSort(model_filter)
|
||||||
self.set_sort_functions()
|
self.set_sort_functions()
|
||||||
self.treeview.set_model(self.model_filter)
|
self.treeview.set_model(self.model_filter)
|
||||||
if sort_column and sort_column != (None, None):
|
|
||||||
self.model_filter.set_sort_column_id(*sort_column)
|
|
||||||
|
|
||||||
def set_sort_functions(self):
|
def set_sort_functions(self):
|
||||||
for column in self.columns.values():
|
for column in self.columns.values():
|
||||||
if column.sort_func:
|
if column.sort_func:
|
||||||
log.debug("sort_func: %s sort_id: %s", column.sort_func, column.sort_id)
|
|
||||||
self.model_filter.set_sort_func(
|
self.model_filter.set_sort_func(
|
||||||
column.sort_id,
|
column.sort_id,
|
||||||
column.sort_func,
|
column.sort_func,
|
||||||
|
|
|
@ -279,10 +279,11 @@ class TorrentView(listview.ListView, component.Component):
|
||||||
if not torrent_id in status.keys():
|
if not torrent_id in status.keys():
|
||||||
row[filter_column] = False
|
row[filter_column] = False
|
||||||
else:
|
else:
|
||||||
|
row[filter_column] = True
|
||||||
if torrent_id in self.prev_status and status[torrent_id] == self.prev_status[torrent_id]:
|
if torrent_id in self.prev_status and status[torrent_id] == self.prev_status[torrent_id]:
|
||||||
# The status dict is the same, so do not update
|
# The status dict is the same, so do not update
|
||||||
continue
|
continue
|
||||||
row[filter_column] = True
|
|
||||||
# Set values for each column in the row
|
# Set values for each column in the row
|
||||||
for column in self.columns_to_update:
|
for column in self.columns_to_update:
|
||||||
column_index = self.get_column_index(column)
|
column_index = self.get_column_index(column)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue