[Pkg-privacy-commits] [onionshare] 199/256: Move the readable file check from FileSelection to FileList, so files you drag-and-drop into OnionShare get checked as well

Ulrike Uhlig ulrike at moszumanska.debian.org
Fri May 26 12:53:40 UTC 2017


This is an automated email from the git hooks/post-receive script.

ulrike pushed a commit to branch master
in repository onionshare.

commit c4ad8353226a660acecee3cdbefc41041323a136
Author: Micah Lee <micah at micahflee.com>
Date:   Thu May 18 10:55:10 2017 -0700

    Move the readable file check from FileSelection to FileList, so files you drag-and-drop into OnionShare get checked as well
---
 onionshare_gui/file_selection.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/onionshare_gui/file_selection.py b/onionshare_gui/file_selection.py
index 49b811c..2ebbbb7 100644
--- a/onionshare_gui/file_selection.py
+++ b/onionshare_gui/file_selection.py
@@ -130,6 +130,10 @@ class FileList(QtWidgets.QListWidget):
         Add a file or directory to this widget.
         """
         if filename not in self.filenames:
+            if not os.access(filename, os.R_OK):
+                Alert(strings._("not_a_readable_file", True).format(filename))
+                return
+
             self.filenames.append(filename)
 
             fileinfo = QtCore.QFileInfo(filename)
@@ -214,10 +218,7 @@ class FileSelection(QtWidgets.QVBoxLayout):
             caption=strings._('gui_choose_files', True), options=QtWidgets.QFileDialog.ReadOnly)
         if filenames:
             for filename in filenames[0]:
-                if not os.access(filename, os.R_OK):
-                    Alert(strings._("not_a_readable_file", True).format(filename))
-                else:
-                    self.file_list.add_file(filename)
+                self.file_list.add_file(filename)
         self.update()
 
     def add_dir(self):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onionshare.git



More information about the Pkg-privacy-commits mailing list