Fix exception in tag browser/view when a category goes away

This commit is contained in:
Charles Haley 2011-07-01 16:52:49 +01:00
parent 7f84408da2
commit c3eb10f51d

View File

@ -575,7 +575,8 @@ class TagsView(QTreeView): # {{{
expanded_categories, state_map = self.get_state() expanded_categories, state_map = self.get_state()
self._model.rebuild_node_tree(state_map=state_map) self._model.rebuild_node_tree(state_map=state_map)
for category in expanded_categories: for category in expanded_categories:
self.expand(self._model.index_for_category(category)) if self._model.index_for_category(category) is not None:
self.expand(self._model.index_for_category(category))
self.show_item_at_path(path) self.show_item_at_path(path)
def show_item_at_path(self, path, box=False, def show_item_at_path(self, path, box=False,