Module: deluge
Branch: 1.3-stable
Commit: 62a1602d5ad11b00272ba39db88144a19b2904e7

Author: Calum Lind <calumlind+del...@gmail.com>
Date:   Wed Dec  5 18:10:53 2012 +0000

Fix #2129 : Empty filename can be set in AddTorrent dialog

---

 deluge/ui/gtkui/addtorrentdialog.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/deluge/ui/gtkui/addtorrentdialog.py 
b/deluge/ui/gtkui/addtorrentdialog.py
index 3283cef..bc970ae 100644
--- a/deluge/ui/gtkui/addtorrentdialog.py
+++ b/deluge/ui/gtkui/addtorrentdialog.py
@@ -844,7 +844,7 @@ class AddTorrentDialog(component.Component):
     def _on_filename_edited(self, renderer, path, new_text):
         index = self.files_treestore[path][3]
 
-        new_text = new_text.strip(os.path.sep)
+        new_text = new_text.strip(os.path.sep).strip()
 
         # Return if the text hasn't changed
         if new_text == self.files_treestore[path][1]:
@@ -862,6 +862,8 @@ class AddTorrentDialog(component.Component):
 
         if index > -1:
             # We're renaming a file! Yay! That's easy!
+            if not new_text:
+                return
             parent = self.files_treestore.iter_parent(itr)
             file_path = os.path.join(self.get_file_path(parent), new_text)
 

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to deluge-commit@googlegroups.com.
To unsubscribe from this group, send email to 
deluge-commit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to