From cd2084b4215c6e38c9ecab37bdc6737fde9cb455 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Mon, 29 Sep 2008 23:52:53 +0000 Subject: [PATCH] Improve performance of files tab by only updating when values change --- ChangeLog | 3 +++ deluge/ui/gtkui/files_tab.py | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 32aa7346d..f8d282346 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,9 @@ Deluge 1.0.1 (In Development) will automatically open more slots to meet the upload speed limit. * Fix display of tracker error messages + GtkUI: + * Improve performance of files tab by only updating when values change + Misc: * Fix #187 set a 5 second timer to save the config file after a config value has been changed. diff --git a/deluge/ui/gtkui/files_tab.py b/deluge/ui/gtkui/files_tab.py index edd62c4e1..95437c2d2 100644 --- a/deluge/ui/gtkui/files_tab.py +++ b/deluge/ui/gtkui/files_tab.py @@ -382,9 +382,15 @@ class FilesTab(Tab): self.get_files_from_tree(self.treestore, files_list, 0) files_list.sort() for index, row in files_list: - row[2] = "%.2f%%" % (status["file_progress"][index] * 100) - row[3] = status["file_progress"][index] * 100 - row[4] = status["file_priorities"][index] + progress_string = "%.2f%%" % (status["file_progress"][index] * 100) + if row[2] != progress_string: + row[2] = progress_string + progress_value = status["file_progress"][index] * 100 + if row[3] != progress_value: + row[3] = progress_value + file_priority = status["file_priorities"][index] + if row[4] != file_priority: + row[4] = file_priority def _on_button_press_event(self, widget, event): """This is a callback for showing the right-click context menu."""