From fd4bc51ec294d4ae058cea28ade86efbdf0b2868 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Wed, 21 Feb 2018 15:29:56 +1100 Subject: [PATCH] fix appending of filenames when checking that a file hasn't already been added to the list --- onionshare_gui/file_selection.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/onionshare_gui/file_selection.py b/onionshare_gui/file_selection.py index 4f4c43f2..270baef7 100644 --- a/onionshare_gui/file_selection.py +++ b/onionshare_gui/file_selection.py @@ -82,8 +82,6 @@ class FileList(QtWidgets.QListWidget): self.setMinimumHeight(205) self.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection) - self.filenames = [] - self.drop_here_image = DropHereLabel(self, True) self.drop_here_text = DropHereLabel(self, False) self.drop_count = DropCountLabel(self) @@ -194,9 +192,9 @@ class FileList(QtWidgets.QListWidget): Add a file or directory to this widget. """ for index in range(self.count()): - self.filenames.append(self.item(index)) + filenames.append(self.item(index).filename) - if filename not in self.filenames: + if filename not in filenames: if not os.access(filename, os.R_OK): Alert(strings._("not_a_readable_file", True).format(filename)) return