From 6aa925a8edc5b3e9038ec5a74086c94ac87781ce Mon Sep 17 00:00:00 2001
From: David Mohr <david@mcbf.net>
Date: Wed, 31 Mar 2010 22:45:57 -0600
Subject: [PATCH] Correctly store and restore the sort_column_id
---
deluge/ui/gtkui/files_tab.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/deluge/ui/gtkui/files_tab.py b/deluge/ui/gtkui/files_tab.py
index f81820b..bc1bdcd 100644
a
|
b
|
def save_state(self):
|
230 | 230 | # Setup state dict |
231 | 231 | state = { |
232 | 232 | "columns": {}, |
233 | | "sort_id": column_id, |
234 | | "sort_order": int(sort_order) if sort_order else None |
| 233 | "sort_id": int(column_id) if column_id >= 0 else None, |
| 234 | "sort_order": int(sort_order) if sort_order >= 0 else None |
235 | 235 | } |
236 | 236 | |
237 | 237 | for index, column in enumerate(self.listview.get_columns()): |
… |
… |
def load_state(self):
|
268 | 268 | if state == None: |
269 | 269 | return |
270 | 270 | |
271 | | if state["sort_id"] and state["sort_order"] is not None: |
| 271 | if state["sort_id"] is not None and state["sort_order"] is not None: |
272 | 272 | self.treestore.set_sort_column_id(state["sort_id"], state["sort_order"]) |
273 | 273 | |
274 | 274 | for (index, column) in enumerate(self.listview.get_columns()): |