[gnome-system-monitor] Do not clear the load graph when switching to/from stacked



commit 5b2598f9edfb39f802ec45f4c839d2eba31b4b20
Author: Robert Roth <robert roth off gmail com>
Date:   Mon Jan 20 14:08:47 2014 +0200

    Do not clear the load graph when switching to/from stacked

 src/application.cpp |    1 -
 src/load-graph.cpp  |   11 +++--------
 2 files changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/src/application.cpp b/src/application.cpp
index 334978b..eb52bbc 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -35,7 +35,6 @@ cb_draw_stacked_changed (GSettings *settings, const gchar *key, gpointer data)
 
     app->config.draw_stacked = g_settings_get_boolean(settings, key);
     app->cpu_graph->clear_background();
-    load_graph_reset(app->cpu_graph);
 }
 
 
diff --git a/src/load-graph.cpp b/src/load-graph.cpp
index e06d5d4..7b79c3b 100644
--- a/src/load-graph.cpp
+++ b/src/load-graph.cpp
@@ -276,8 +276,6 @@ load_graph_draw (GtkWidget *widget,
         }
         if (drawStacked) {
             cairo_rel_line_to (cr, 0, graph->real_draw_height + 3.5f);
-            //cairo_stroke_preserve(cr);
-            //cairo_close_path(cr);
             cairo_fill(cr);
         } else {
             cairo_stroke (cr);
@@ -322,7 +320,6 @@ get_load (LoadGraph *graph)
     // that value has no meaning, we just want all the
     // graphs to be aligned, so the CPU graph needs to start
     // immediately
-    bool drawStacked = graph->type == LOAD_GRAPH_CPU && GsmApplication::get()->config.draw_stacked;
 
     for (i = 0; i < graph->n; i++) {
         float load;
@@ -334,11 +331,9 @@ get_load (LoadGraph *graph)
 
         load = used / MAX(total, 1.0f);
         graph->data[0][i] = load;
-        if (drawStacked) {
-            graph->data[0][i] /= graph->n;
-            if (i > 0) {
-                graph->data[0][i] += graph->data[0][i-1];
-            }
+        graph->data[0][i] /= graph->n;
+        if (i > 0) {
+            graph->data[0][i] += graph->data[0][i-1];
         }
 
         /* Update label */


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