From 087bcee6208f73fca214f7d9fef5f346883e74ba Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 6 Nov 2013 21:45:27 +0530 Subject: [PATCH] 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) --- src/calibre/gui2/actions/mark_books.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/actions/mark_books.py b/src/calibre/gui2/actions/mark_books.py index 2dfdc2781b..60135fedf6 100644 --- a/src/calibre/gui2/actions/mark_books.py +++ b/src/calibre/gui2/actions/mark_books.py @@ -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)