Fix #2130 : Same name can be given to different files in Add Torrent dialog

This commit is contained in:
Calum Lind 2012-12-05 18:12:08 +00:00
parent 62a1602d5a
commit ccd2e5e41d

View file

@ -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