diff options
author | Calum Lind <calumlind+deluge@gmail.com> | 2012-12-05 18:12:08 +0000 |
---|---|---|
committer | Calum Lind <calumlind+deluge@gmail.com> | 2012-12-05 18:28:17 +0000 |
commit | bb5dbecbf2f56db1f9df998b1035ff3d4d2e1817 (patch) | |
tree | ac48fe7717eee7d16e0659b6b326aa8d3ae214f8 | |
parent | eed46994da86d010fc899dd91eee33d91b47dd9f (diff) | |
download | deluge-bb5dbecbf2.tar.gz deluge-bb5dbecbf2.tar.bz2 deluge-bb5dbecbf2.zip |
Fix #2130 : Same name can be given to different files in Add Torrent dialog
-rw-r--r-- | deluge/ui/gtkui/addtorrentdialog.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/deluge/ui/gtkui/addtorrentdialog.py b/deluge/ui/gtkui/addtorrentdialog.py index aee0c5323..74eff669f 100644 --- a/deluge/ui/gtkui/addtorrentdialog.py +++ b/deluge/ui/gtkui/addtorrentdialog.py @@ -886,7 +886,10 @@ class AddTorrentDialog(component.Component): return parent = self.files_treestore.iter_parent(itr) file_path = os.path.join(self.get_file_path(parent), new_text) - + # Don't rename if filename exists + for row in self.files_treestore[parent].iterchildren(): + if new_text == row[1] and row[3] > -1: + return if os.path.sep in new_text: # There are folders in this path, so we need to create them # and then move the file iter to top |