0.8.73, fix gui stats
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 7 Dec 2006 23:02:42 +0000 (23:02 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 7 Dec 2006 23:02:42 +0000 (23:02 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2295 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/configure.in
ltt/branches/poly/lttv/modules/gui/detailedevents/events.c
ltt/branches/poly/lttv/modules/gui/statistics/statistics.c

index 91bd5ffe55e7242c2d14fb62b51a2f0a85ccc22c..03a2c4b9c6c64aa5198218296f5519e93886944a 100644 (file)
@@ -23,7 +23,7 @@
 AC_PREREQ(2.57)
 AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
 #AC_WITH_LTDL  # not needed ?
-AM_INIT_AUTOMAKE(LinuxTraceToolkitViewer,0.8.72-06122006)
+AM_INIT_AUTOMAKE(LinuxTraceToolkitViewer,0.8.73-07122006)
 AM_CONFIG_HEADER(config.h)
 AM_PROG_LIBTOOL
 
index e8f0c53a1f708760a0a85f45f3309cb3d130b8a2..5f4fc90dd295379ae1ad40eb02bbec9cfd28c439 100644 (file)
@@ -583,7 +583,7 @@ static void request_background_data(EventViewerData *event_viewer_data)
       }
     } else {
       /* Data ready. By its nature, this viewer doesn't need to have
-       * its data ready hook called htere, because a background
+       * its data ready hook called there, because a background
        * request is always linked with a redraw.
        */
     }
index 8efa6b26a228ce06d2c689755d6e9133735fd785..7e781adbca6281d99ccc36cd9f4ef0191827fcb2 100644 (file)
@@ -115,6 +115,8 @@ struct _StatisticViewerData{
   
   //hash 
   GHashTable *statistic_hash;
+
+  guint background_info_waiting;
 };
 
 
@@ -132,12 +134,16 @@ static gint background_ready(void *hook_data, void *call_data)
   Tab *tab = svd->tab;
   LttvTrace *trace = (LttvTrace*)call_data;
 
-  g_debug("statistics viewer : background computation data ready.");
+  svd->background_info_waiting--;
+
+  if(svd->background_info_waiting == 0) {
+    g_message("statistics viewer : background computation data ready.");
 
-  gtk_tree_store_clear (svd->store_m);
+    gtk_tree_store_clear (svd->store_m);
 
-  lttv_stats_sum_traceset(lttvwindow_get_traceset_stats(tab));
-  show_traceset_stats(svd);
+    lttv_stats_sum_traceset(lttvwindow_get_traceset_stats(tab));
+    show_traceset_stats(svd);
+  }
 
   return 0;
 }
@@ -153,11 +159,15 @@ static void request_background_data(StatisticViewerData *svd)
   gint num_traces = lttvwindowtraces_get_number();
   gint i;
   LttvTrace *trace;
+  GtkTextBuffer* buf;
 
   LttvHooks *background_ready_hook = 
     lttv_hooks_new();
   lttv_hooks_add(background_ready_hook, background_ready, svd,
       LTTV_PRIO_DEFAULT);
+  svd->background_info_waiting = num_traces;
+  buf = gtk_text_view_get_buffer((GtkTextView*)svd->text_v);
+  gtk_text_buffer_set_text(buf,"", -1);
   
   for(i=0;i<num_traces;i++) {
     trace = lttvwindowtraces_get_trace(i);
@@ -179,7 +189,6 @@ static void request_background_data(StatisticViewerData *svd)
                                                  NULL,
                                                  background_ready_hook);
       } else { /* in progress */
-      
         lttvwindowtraces_background_notify_current(svd,
                                                    trace,
                                                    ltt_time_infinite,
@@ -192,6 +201,11 @@ static void request_background_data(StatisticViewerData *svd)
       lttv_hooks_call(background_ready_hook, NULL);
     }
   }
+
+  if(num_traces == 0) {
+    svd->background_info_waiting = 1;
+    lttv_hooks_call(background_ready_hook, NULL);
+  }
   lttv_hooks_destroy(background_ready_hook);
 }
 
@@ -431,7 +445,7 @@ void show_traceset_stats(StatisticViewerData * statistic_viewer_data)
   
   ts = tscs->parent.parent.ts;
   nb = lttv_traceset_number(ts);
-  if(nb == 0)return;
+  if(nb == 0) return;
 
   gtk_tree_store_append (store, &iter, NULL);  
   gtk_tree_store_set (store, &iter,
This page took 0.027379 seconds and 4 git commands to generate.