Module: deluge Branch: 1.3-stable Commit: ccd2e5e41d7b0127fc589b1e6bf6560894440ecd
Author: Calum Lind <[email protected]> Date: Wed Dec 5 18:12:08 2012 +0000 Fix #2130 : Same name can be given to different files in Add Torrent dialog --- 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 bc970ae..b9c8359 100644 --- a/deluge/ui/gtkui/addtorrentdialog.py +++ b/deluge/ui/gtkui/addtorrentdialog.py @@ -866,7 +866,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 -- You received this message because you are subscribed to the Google Groups "deluge-commit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/deluge-commit?hl=en.
