Fix #1018 issue with 2nd level folder rename in the gtkui and save resume data on file/folder renamed

This commit is contained in:
Andrew Resch 2009-10-03 22:10:38 +00:00
parent fbd6db859f
commit cb36beded4
2 changed files with 3 additions and 1 deletions

View File

@ -962,6 +962,7 @@ class TorrentManager(component.Component):
# This is the last alert we were waiting for, time to send signal # 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])) component.get("EventManager").emit(TorrentFolderRenamedEvent(torrent_id, wait_on_folder[0], wait_on_folder[1]))
del torrent.waiting_on_folder_rename[i] del torrent.waiting_on_folder_rename[i]
self.save_resume_data((torrent_id,))
break break
# This isn't the last file to be renamed in this folder, so just # This isn't the last file to be renamed in this folder, so just
# remove the index and continue # remove the index and continue
@ -970,6 +971,7 @@ class TorrentManager(component.Component):
if not folder_rename: if not folder_rename:
# This is just a regular file rename so send the signal # This is just a regular file rename so send the signal
component.get("EventManager").emit(TorrentFileRenamedEvent(torrent_id, alert.index, alert.name)) component.get("EventManager").emit(TorrentFileRenamedEvent(torrent_id, alert.index, alert.name))
self.save_resume_data((torrent_id,))
def on_alert_metadata_received(self, alert): def on_alert_metadata_received(self, alert):
log.debug("on_alert_metadata_received") log.debug("on_alert_metadata_received")

View File

@ -741,7 +741,7 @@ class FilesTab(Tab):
new_folder_iter = self.get_iter_at_path(new_folder) new_folder_iter = self.get_iter_at_path(new_folder)
if len(new_split) == len(old_split): if len(new_split) == len(old_split):
# These are at the same tree depth, so it's a simple rename # 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 return
if new_folder_iter: if new_folder_iter:
# This means that a folder by this name already exists # This means that a folder by this name already exists