summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2006-05-09 18:18:08 +0000
committerHisham Muhammad <hisham@gobolinux.org>2006-05-09 18:18:08 +0000
commitc3d757f606a2ffdfa69643aa74ce72fea10b60da (patch)
tree03ec5b74e2ed0d25e8102fa3c646b6829eb7440a
parent7d930a21f13116591e7d38df0bbc590856fdb575 (diff)
Enable "All CPUs" option
-rw-r--r--AvailableMetersListBox.c2
-rw-r--r--Meter.c19
2 files changed, 10 insertions, 11 deletions
diff --git a/AvailableMetersListBox.c b/AvailableMetersListBox.c
index 21c0eddb..88011bab 100644
--- a/AvailableMetersListBox.c
+++ b/AvailableMetersListBox.c
@@ -37,7 +37,7 @@ AvailableMetersListBox* AvailableMetersListBox_new(Settings* settings, ListBox*
ListBox_setHeader(super, "Available meters");
for (int i = 1; Meter_types[i]; i++) {
MeterType* type = Meter_types[i];
- if (type != &CPUMeter && type != &AllCPUsMeter) {
+ if (type != &CPUMeter) {
ListBox_add(super, (Object*) ListItem_new(type->uiName, i << 16));
}
}
diff --git a/Meter.c b/Meter.c
index 97a8707c..e95cf308 100644
--- a/Meter.c
+++ b/Meter.c
@@ -219,7 +219,7 @@ inline static void Meter_displayToStringBuffer(Meter* this, char* buffer) {
}
void Meter_setMode(Meter* this, int modeIndex) {
- if (modeIndex == this->mode)
+ if (modeIndex > 0 && modeIndex == this->mode)
return;
if (!modeIndex)
modeIndex = 1;
@@ -227,15 +227,14 @@ void Meter_setMode(Meter* this, int modeIndex) {
if (this->type->mode == 0) {
this->draw = this->type->draw;
} else {
- if (modeIndex >= 1) {
- if (this->drawBuffer)
- free(this->drawBuffer);
- this->drawBuffer = NULL;
-
- MeterMode* mode = Meter_modes[modeIndex];
- this->draw = mode->draw;
- this->h = mode->h;
- }
+ assert(modeIndex >= 1);
+ if (this->drawBuffer)
+ free(this->drawBuffer);
+ this->drawBuffer = NULL;
+
+ MeterMode* mode = Meter_modes[modeIndex];
+ this->draw = mode->draw;
+ this->h = mode->h;
}
this->mode = modeIndex;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy