mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 16:38:43 +00:00
Fix #1786:
Don't reorder duplicate columns, need to dig how duplicate columns got into the state file, and also skip non visible columns.
This commit is contained in:
parent
d258794517
commit
b9a688013f
1 changed files with 9 additions and 0 deletions
|
@ -615,7 +615,15 @@ class ListView:
|
||||||
if column.get_title() == header:
|
if column.get_title() == header:
|
||||||
return column
|
return column
|
||||||
|
|
||||||
|
restored_columns = []
|
||||||
for col_state in self.state:
|
for col_state in self.state:
|
||||||
|
if col_state.name in restored_columns:
|
||||||
|
# Duplicate column in state!?!?!?
|
||||||
|
continue
|
||||||
|
elif not col_state.visible:
|
||||||
|
# Column is not visible, no need to reposition
|
||||||
|
continue
|
||||||
|
|
||||||
column_at_position = columns[col_state.position]
|
column_at_position = columns[col_state.position]
|
||||||
if col_state.name == column_at_position.get_title():
|
if col_state.name == column_at_position.get_title():
|
||||||
# It's in the right position
|
# It's in the right position
|
||||||
|
@ -624,4 +632,5 @@ class ListView:
|
||||||
self.treeview.move_column_after(column, column_at_position)
|
self.treeview.move_column_after(column, column_at_position)
|
||||||
# Get columns again to keep reordering since positions have changed
|
# Get columns again to keep reordering since positions have changed
|
||||||
columns = self.treeview.get_columns()
|
columns = self.treeview.get_columns()
|
||||||
|
restored_columns.append(col_state.name)
|
||||||
self.create_new_liststore()
|
self.create_new_liststore()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue