mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04: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
@ -519,7 +519,9 @@ class FileList(QTreeWidget):
|
|||||||
if unicode(child.data(0, NAME_ROLE).toString()) in other_removals:
|
if unicode(child.data(0, NAME_ROLE).toString()) in other_removals:
|
||||||
removals.append(child)
|
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)
|
c.parent().removeChild(c)
|
||||||
|
|
||||||
def dropEvent(self, event):
|
def dropEvent(self, event):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user