From cb36beded4fdd9aa4628836d5b2776345871d95d Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sat, 3 Oct 2009 22:10:38 +0000 Subject: [PATCH] Fix #1018 issue with 2nd level folder rename in the gtkui and save resume data on file/folder renamed --- deluge/core/torrentmanager.py | 2 ++ deluge/ui/gtkui/files_tab.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index 3f3738cd8..3d947bb0e 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -962,6 +962,7 @@ class TorrentManager(component.Component): # This is the last alert we were waiting for, time to send signal component.get("EventManager").emit(TorrentFolderRenamedEvent(torrent_id, wait_on_folder[0], wait_on_folder[1])) del torrent.waiting_on_folder_rename[i] + self.save_resume_data((torrent_id,)) break # This isn't the last file to be renamed in this folder, so just # remove the index and continue @@ -970,6 +971,7 @@ class TorrentManager(component.Component): if not folder_rename: # This is just a regular file rename so send the signal component.get("EventManager").emit(TorrentFileRenamedEvent(torrent_id, alert.index, alert.name)) + self.save_resume_data((torrent_id,)) def on_alert_metadata_received(self, alert): log.debug("on_alert_metadata_received") diff --git a/deluge/ui/gtkui/files_tab.py b/deluge/ui/gtkui/files_tab.py index efc316a4b..6282bbd49 100644 --- a/deluge/ui/gtkui/files_tab.py +++ b/deluge/ui/gtkui/files_tab.py @@ -741,7 +741,7 @@ class FilesTab(Tab): new_folder_iter = self.get_iter_at_path(new_folder) if len(new_split) == len(old_split): # These are at the same tree depth, so it's a simple rename - self.treestore[old_folder_iter][0] = new_folder + self.treestore[old_folder_iter][0] = new_split[-1] + "/" return if new_folder_iter: # This means that a folder by this name already exists