summaryrefslogtreecommitdiff
path: root/onionshare_gui
diff options
context:
space:
mode:
authorMiguel Jacq <mig@mig5.net>2018-02-21 15:29:56 +1100
committerMiguel Jacq <mig@mig5.net>2018-02-21 15:29:56 +1100
commitfd4bc51ec294d4ae058cea28ade86efbdf0b2868 (patch)
tree1083faa2e9934ce264cd8248fe10ecafa73001d7 /onionshare_gui
parent21b08252d3569848eab4178597585b686b0a332c (diff)
downloadonionshare-fd4bc51ec294d4ae058cea28ade86efbdf0b2868.tar.gz
onionshare-fd4bc51ec294d4ae058cea28ade86efbdf0b2868.zip
fix appending of filenames when checking that a file hasn't already been added to the list
Diffstat (limited to 'onionshare_gui')
-rw-r--r--onionshare_gui/file_selection.py6
1 files 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