Skip to content

Commit

Permalink
Edit Book: Fix drag and drop of multiple items in the File Browser ca…
Browse files Browse the repository at this point in the history
…using item order to be reversed.
  • Loading branch information
kovidgoyal committed Apr 16, 2017
1 parent 287fa21 commit 89eb3a5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/calibre/gui2/tweak_book/file_list.py
Expand Up @@ -658,9 +658,7 @@ def __exit__(self, *args):
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):
Expand Down

0 comments on commit 89eb3a5

Please sign in to comment.