Changing filenames of files within a folder will keep the file in the folder.

This commit is contained in:
Andrew Resch 2008-10-14 18:56:09 +00:00
parent 70a58e969f
commit f8ad5ddb37
1 changed files with 14 additions and 1 deletions

View File

@ -476,7 +476,20 @@ class FilesTab(Tab):
def _on_filename_edited(self, renderer, path, new_text):
index = self.treestore[path][5]
client.rename_files(self.torrent_id, [(index, new_text)])
itr = self.treestore.get_iter(path)
# Recurse through the treestore to get the actual path of the file
def get_filepath(i, fp):
if self.treestore.iter_parent(i):
fp = get_filepath(self.treestore.iter_parent(i), fp)
else:
fp += self.treestore[i][0]
return fp
return fp
filepath = get_filepath(itr, str()) + new_text
log.debug("filepath: %s", filepath)
client.rename_files(self.torrent_id, [(index, filepath)])
self._editing_index = None
def _on_filename_editing_start(self, renderer, editable, path):