Use the QListWidgetItems for building lists of filenames. Set, but avoid displaying, the QString from Qt.DisplayRole which is necessary for correct sorting in the list

This commit is contained in:
Miguel Jacq 2018-02-21 15:19:18 +11:00
parent 4002bb5547
commit 21b08252d3
No known key found for this signature in database
GPG key ID: EEA4341C6D97A0B6
2 changed files with 18 additions and 11 deletions

View file

@ -410,8 +410,11 @@ class OnionShareGui(QtWidgets.QMainWindow):
# add progress bar to the status bar, indicating the crunching of files.
self._zip_progress_bar = ZipProgressBar(0)
self._zip_progress_bar.total_files_size = OnionShareGui._compute_total_size(
self.file_selection.file_list.filenames)
self.filenames = []
for index in range(self.file_selection.file_list.count()):
self.filenames.append(self.file_selection.file_list.item(index).filename)
self._zip_progress_bar.total_files_size = OnionShareGui._compute_total_size(self.filenames)
self.status_bar.insertWidget(0, self._zip_progress_bar)
# prepare the files for sending in a new thread
@ -421,7 +424,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
if self._zip_progress_bar != None:
self._zip_progress_bar.update_processed_size_signal.emit(x)
try:
web.set_file_info(self.file_selection.file_list.filenames, processed_size_callback=_set_processed_size)
web.set_file_info(self.filenames, processed_size_callback=_set_processed_size)
self.app.cleanup_filenames.append(web.zip_filename)
self.starting_server_step3.emit()