mirror of
https://github.com/onionshare/onionshare.git
synced 2025-02-05 01:15:29 -05:00
Ensure the self.filenames list is sorted internally.
This is important because even though the QListWidget UI is sorted automatically, the list is not necessarily. Drag-drop events, depending on the order in which items were highlighted before being dragged, can result in a different or reversed order. This has implications for popping the list later (e.g on delete events)
This commit is contained in:
parent
a9ee14551b
commit
64b5cc59bb
@ -136,6 +136,8 @@ class FileList(QtWidgets.QListWidget):
|
||||
return
|
||||
|
||||
self.filenames.append(filename)
|
||||
# Re-sort the list internally
|
||||
self.filenames.sort()
|
||||
|
||||
fileinfo = QtCore.QFileInfo(filename)
|
||||
basename = os.path.basename(filename.rstrip('/'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user