mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-02 10:04:17 +02:00
Edit book: Fix crash that happens sometimes when deleting multiple files. Fixes #1263179 [Editor quits while deleting files with "delte" key](https://bugs.launchpad.net/calibre/+bug/1263179)
This commit is contained in:
parent
57f6dcf579
commit
f9ed3306ce
1 changed files with 3 additions and 1 deletions
|
|
@ -519,7 +519,9 @@ def delete_done(self, spine_removals, other_removals):
|
|||
if unicode(child.data(0, NAME_ROLE).toString()) in other_removals:
|
||||
removals.append(child)
|
||||
|
||||
for c in removals:
|
||||
# The sorting by index is necessary otherwise Qt crashes with recursive
|
||||
# repaint detected message
|
||||
for c in sorted(removals, key=lambda x:x.parent().indexOfChild(x), reverse=True):
|
||||
c.parent().removeChild(c)
|
||||
|
||||
def dropEvent(self, event):
|
||||
|
|
|
|||
Loading…
Reference in a new issue