Sort files in Extract dialog alphabetically. By @samuel-w (#741)

This commit is contained in:
samuel-w 2020-12-15 21:23:30 -06:00 committed by GitHub
parent 6d0ef769c6
commit abd41b9fea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -187,6 +187,9 @@ class TreeModel(QAbstractItemModel):
selected_files_folders=None, selected_files_folders=None,
parent=None, parent=None,
): ):
files_with_attributes.sort(key=lambda x: x[2].upper()) # Sorts tuples by name ignoring case
files_with_attributes.sort(key=lambda x: x[0] != 0) # Pushes folders (size zero) to start of list
super(TreeModel, self).__init__(parent) super(TreeModel, self).__init__(parent)
self.rootItem = FolderItem( self.rootItem = FolderItem(