Fix number of marked books in menu not being updated when deleting books

Fix number of marked books shown in the drop down menu of the Mark Books
action not being updated when marked books are deleted (as opposed to
being unmarked). Fixes #1248506 [Incorrect number of marked books in "Show marked books" menu entry](https://bugs.launchpad.net/calibre/+bug/1248506)
This commit is contained in:
Kovid Goyal 2013-11-06 21:45:27 +05:30
parent d4b3e94afc
commit 087bcee620

View File

@ -87,7 +87,7 @@ class MarkBooksAction(InterfaceAction):
def about_to_show_menu(self):
db = self.gui.current_db
num = len(db.data.marked_ids)
num = len(frozenset(db.data.marked_ids).intersection(db.new_api.all_book_ids()))
text = _('Show marked book') if num == 1 else (_('Show marked books') + (' (%d)' % num))
self.show_marked_action.setText(text)