Edit Book: Fix drag and drop of multiple items in the File Browser causing item order to be reversed.

This commit is contained in:
Kovid Goyal 2017-04-16 10:32:02 +05:30
parent 287fa218aa
commit 89eb3a59a4

View File

@ -658,9 +658,7 @@ class FileList(QTreeWidget):
def selectedIndexes(self):
ans = QTreeWidget.selectedIndexes(self)
if self.ordered_selected_indexes:
# The reverse is needed because Qt's implementation of dropEvent
# reverses the selectedIndexes when dropping.
ans = list(sorted(ans, key=lambda idx:idx.row(), reverse=True))
ans = list(sorted(ans, key=lambda idx:idx.row()))
return ans
def dropEvent(self, event):