mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3 compat: FIx d&d in file list in editor
Fixes #1887508 [Cannot drag and drop files while editing a book](https://bugs.launchpad.net/calibre/+bug/1887508)
This commit is contained in:
parent
dc64f044db
commit
06f69ee170
@ -792,9 +792,9 @@ class FileList(QTreeWidget, OpenWithHandler):
|
||||
def dropEvent(self, event):
|
||||
with self:
|
||||
text = self.categories['text']
|
||||
pre_drop_order = {text.child(i):i for i in range(text.childCount())}
|
||||
pre_drop_order = {text.child(i).data(0, NAME_ROLE):i for i in range(text.childCount())}
|
||||
super(FileList, self).dropEvent(event)
|
||||
current_order = {text.child(i):i for i in range(text.childCount())}
|
||||
current_order = {text.child(i).data(0, NAME_ROLE):i for i in range(text.childCount())}
|
||||
if current_order != pre_drop_order:
|
||||
order = []
|
||||
for child in (text.child(i) for i in range(text.childCount())):
|
||||
|
Loading…
x
Reference in New Issue
Block a user