diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2012-09-14 12:38:58 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2012-09-14 12:38:58 (GMT) |
commit | 07b3c6d88334e8c20ee45de3d931aa2597b20000 (patch) | |
tree | 2046073fd386bc729066b30db1fa8e96413d954f | |
parent | e80bcb51ae2a589410f9955fcd8a484bb417d55e (diff) |
Do not request random catalog when navigating catalog tree
When moving up in the catalog tree, the list view changed and
triggered a query. This can be slow and is unneeded.
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r-- | GetIABooksActivity.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/GetIABooksActivity.py b/GetIABooksActivity.py index 371ea79..a8645e3 100644 --- a/GetIABooksActivity.py +++ b/GetIABooksActivity.py @@ -401,6 +401,7 @@ class GetIABooksActivity(activity.Activity): return else: # move a level up the tree + self.catalog_listview.handler_block(self._catalog_changed_id) self.catalog_history.pop() len_cat -= 1 if(len_cat == 1): @@ -421,6 +422,7 @@ class GetIABooksActivity(activity.Activity): for p in self.categories: self.path_iter[p['text']] = \ self.treemodel.append([p['text']]) + self.catalog_listview.handler_unblock(self._catalog_changed_id) def move_down_catalog(self, treeview): treestore, coldex = \ @@ -482,7 +484,8 @@ class GetIABooksActivity(activity.Activity): self.catalog_listview.headers_clickble = True self.catalog_listview.hover_expand = True self.catalog_listview.rules_hint = True - self.catalog_listview.connect('cursor-changed', self.move_down_catalog) + self._catalog_changed_id = self.catalog_listview.connect( + 'cursor-changed', self.move_down_catalog) self.catalog_listview.set_enable_search(False) self.treemodel = Gtk.ListStore(str) |