mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix error if a marked book is deleted/merged.
Fixes #1239161 [Unhandled exception using "Mark books" feature](https://bugs.launchpad.net/calibre/+bug/1239161)
This commit is contained in:
parent
0cfc152b05
commit
00e0901249
@ -693,7 +693,13 @@ class BooksView(QTableView): # {{{
|
||||
self.alternate_views.marked_changed(old_marked, current_marked)
|
||||
if bool(old_marked) == bool(current_marked):
|
||||
changed = old_marked | current_marked
|
||||
sections = tuple(map(self.model().db.data.id_to_index, changed))
|
||||
i = self.model().db.data.id_to_index
|
||||
def f(x):
|
||||
try:
|
||||
return i(x)
|
||||
except ValueError:
|
||||
pass
|
||||
sections = tuple(x for x in map(f, changed) if x is not None)
|
||||
self.row_header.headerDataChanged(Qt.Vertical, min(sections), max(sections))
|
||||
else:
|
||||
# Marked items have either appeared or all been removed
|
||||
|
Loading…
x
Reference in New Issue
Block a user