Also used position based indexing when refreshing the Tag browser after a metadata edit

This commit is contained in:
Kovid Goyal 2017-06-28 09:05:32 +05:30
parent f2edf667d6
commit af48f8907b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 1 deletions

View File

@ -346,7 +346,7 @@ class EditMetadataAction(InterfaceAction):
current = self.gui.library_view.currentIndex() current = self.gui.library_view.currentIndex()
self.gui.refresh_cover_browser() self.gui.refresh_cover_browser()
m.current_changed(current, previous or current) m.current_changed(current, previous or current)
self.gui.tags_view.recount() self.gui.tags_view.recount_with_position_based_index()
def do_edit_metadata(self, row_list, current_row, editing_multiple): def do_edit_metadata(self, row_list, current_row, editing_multiple):
from calibre.gui2.metadata.single import edit_metadata from calibre.gui2.metadata.single import edit_metadata

View File

@ -769,6 +769,10 @@ class TagsView(QTreeView): # {{{
idx = idx.parent() idx = idx.parent()
return self.isExpanded(idx) return self.isExpanded(idx)
def recount_with_position_based_index(self):
self._model.use_position_based_index_on_next_recount = True
self.recount()
def recount(self, *args): def recount(self, *args):
''' '''
Rebuild the category tree, expand any categories that were expanded, Rebuild the category tree, expand any categories that were expanded,