From c33d682de701d92d027fe8968b153c613602ffee Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 24 Dec 2014 20:41:51 +0530 Subject: [PATCH] Fix deleting a book from both the library and the device causing the next selected book to be incorrect, when the library is sorted by the On Device column. Fixes #1404629 [Deleting a book both in device and library makes cursor jump](https://bugs.launchpad.net/calibre/+bug/1404629) --- src/calibre/gui2/actions/delete.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/actions/delete.py b/src/calibre/gui2/actions/delete.py index 4e08805da6..2bf3e6d336 100644 --- a/src/calibre/gui2/actions/delete.py +++ b/src/calibre/gui2/actions/delete.py @@ -332,6 +332,7 @@ class DeleteAction(InterfaceAction): def do_library_delete(self, to_delete_ids): view = self.gui.current_view() + next_id = view.next_id # Ask the user if they want to delete the book from the library or device if it is in both. if self.gui.device_manager.is_device_present: on_device = False @@ -360,7 +361,6 @@ class DeleteAction(InterfaceAction): 'removed from your calibre library. Are you sure?')%len(to_delete_ids) +'

', 'library_delete_books', self.gui): return - next_id = view.next_id if len(to_delete_ids) < 5: try: view.model().delete_books_by_id(to_delete_ids)