[hamster-applet] activity monitoring is happening in the big file. also don't die if the data is gone



commit 85c0298b5ef5fb916613899f082d75b9713f4f10
Author: Toms Bauģis <toms baugis gmail com>
Date:   Mon Dec 21 23:52:09 2009 +0000

    activity monitoring is happening in the big file. also don't die if the data is gone

 hamster/stats_reports.py |   20 ++++----------------
 1 files changed, 4 insertions(+), 16 deletions(-)
---
diff --git a/hamster/stats_reports.py b/hamster/stats_reports.py
index d4fb7c8..a9fe0c7 100644
--- a/hamster/stats_reports.py
+++ b/hamster/stats_reports.py
@@ -104,11 +104,7 @@ class ReportsBox(gtk.VBox):
                                                    animate = False)
         self.get_widget("totals_by_activity").add(self.activity_chart);
 
-        
-        runtime.dispatcher.add_handler('activity_updated', self.after_activity_update)
-        runtime.dispatcher.add_handler('day_updated', self.after_fact_update)
-
-
+        # TODO - this is horribly expensive. cache it in db!
         self.popular_categories = [cat[0] for cat in runtime.storage.get_popular_categories()]
 
         self._gui.connect_signals(self)
@@ -284,17 +280,6 @@ class ReportsBox(gtk.VBox):
         """ skip one variable (huh) """
         return self._gui.get_object(name)
 
-
-
-
-    def after_activity_update(self, widget, renames):
-        self.do_graph()
-    
-    def after_fact_update(self, event, date):
-        self.popular_categories = [cat[0] for cat in runtime.storage.get_popular_categories()]
-        self.do_graph()
-
-
     def init_report_dialog(self):
         chooser = self.get_widget('save_report_dialog')
         chooser.set_action(gtk.FILE_CHOOSER_ACTION_SAVE)
@@ -384,6 +369,9 @@ class ReportsBox(gtk.VBox):
 
 
 def parent_painter(column, cell, model, iter):
+    if not model.get_value(iter, 3):
+        return
+    
     count = int(model.get_value(iter, 3))
     
     if count > 1:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]