From 4e79fe3f7dfae1c8b3c885114b6f2edb7c2c9f79 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Tue, 14 Oct 2008 19:09:50 +0000 Subject: [PATCH] Fix file renaming for files that are not within a folder --- deluge/ui/gtkui/files_tab.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/deluge/ui/gtkui/files_tab.py b/deluge/ui/gtkui/files_tab.py index 8974413a5..8bb55e088 100644 --- a/deluge/ui/gtkui/files_tab.py +++ b/deluge/ui/gtkui/files_tab.py @@ -485,8 +485,13 @@ class FilesTab(Tab): fp += self.treestore[i][0] return fp return fp - - filepath = get_filepath(itr, str()) + new_text + + # Only recurse if file is in a folder.. + if self.treestore.iter_parent(itr): + filepath = get_filepath(itr, str()) + new_text + else: + filepath = new_text + log.debug("filepath: %s", filepath) client.rename_files(self.torrent_id, [(index, filepath)])