mirror of
https://github.com/onionshare/onionshare.git
synced 2025-03-14 18:06:30 -04: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
bb9b66f004
commit
17f18e9a8d
@ -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