From 495182832dbdccb92a751aef3b82dc624ef6be6b Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sat, 29 Nov 2008 23:17:50 +0000 Subject: [PATCH] Fix the files listed in the files tab when renaming files, removing them and then re-adding them to the same session --- deluge/ui/gtkui/files_tab.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deluge/ui/gtkui/files_tab.py b/deluge/ui/gtkui/files_tab.py index a556b1cb2..868a9c00d 100644 --- a/deluge/ui/gtkui/files_tab.py +++ b/deluge/ui/gtkui/files_tab.py @@ -184,6 +184,7 @@ class FilesTab(Tab): # Connect to the 'torrent_file_renamed' signal component.get("Signals").connect_to_signal("torrent_file_renamed", self._on_torrent_file_renamed_signal) component.get("Signals").connect_to_signal("torrent_folder_renamed", self._on_torrent_folder_renamed_signal) + component.get("Signals").connect_to_signal("torrent_removed", self._on_torrent_removed_signal) # Attempt to load state self.load_state() @@ -634,6 +635,10 @@ class FilesTab(Tab): break itr = self.treestore.iter_next(itr) + def _on_torrent_removed_signal(self, torrent_id): + if torrent_id in self.files_list: + del self.files_list[torrent_id] + def _on_drag_data_get_data(self, treeview, context, selection, target_id, etime): indexes = self.get_selected_files() selection.set_text(",".join([str(x) for x in indexes]))