summaryrefslogtreecommitdiff
path: root/src/load-graph.cpp
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-12-18 00:48:24 +0100
committerinfirit <[email protected]>2014-12-18 00:48:24 +0100
commitc9b8c0b000d8533f1e21b1afbc153c279d90b819 (patch)
tree08d96441de7d360c26fa7601e548036bc89db26b /src/load-graph.cpp
parentc8829c37457b28b99b2be815444d5aebfe7a7ad9 (diff)
downloadmate-system-monitor-c9b8c0b000d8533f1e21b1afbc153c279d90b819.tar.bz2
mate-system-monitor-c9b8c0b000d8533f1e21b1afbc153c279d90b819.tar.xz
Stop initializing variables twice in LoadGraph ctor
Taken from GSM commit: e5410092bd1a6edee184aa56fba807498733f06a From: Chris Kühl <[email protected]>
Diffstat (limited to 'src/load-graph.cpp')
-rw-r--r--src/load-graph.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/load-graph.cpp b/src/load-graph.cpp
index a83db22..de27060 100644
--- a/src/load-graph.cpp
+++ b/src/load-graph.cpp
@@ -613,16 +613,16 @@ load_graph_destroy (GtkWidget *widget, gpointer data_ptr)
LoadGraph::LoadGraph(guint type)
- : fontsize(0.0),
- rmargin(0.0),
- indent(0.0),
+ : fontsize(8.0),
+ rmargin(3.5 * fontsize),
+ indent(24.0),
n(0),
- type(0),
+ type(type),
speed(0),
draw_width(0),
draw_height(0),
render_counter(0),
- frames_per_unit(0),
+ frames_per_unit(10), // this will be changed but needs initialising
graph_dely(0),
real_draw_height(0),
graph_delx(0.0),
@@ -640,12 +640,7 @@ LoadGraph::LoadGraph(guint type)
// FIXME:
// on configure, graph->frames_per_unit = graph->draw_width/(LoadGraph::NUM_POINTS);
// knock FRAMES down to 5 until cairo gets faster
- graph->frames_per_unit = 10; // this will be changed but needs initialising
- graph->fontsize = 8.0;
- graph->rmargin = 3.5 * graph->fontsize;
- graph->indent = 24.0;
- graph->type = type;
switch (type) {
case LOAD_GRAPH_CPU:
memset(&this->cpu, 0, sizeof graph->cpu);