projects
/
psensor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
avoid config in the psensor struct
[psensor.git]
/
src
/
main.c
diff --git
a/src/main.c
b/src/main.c
index
f817c14
..
3a126c5
100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-185,18
+185,20
@@
static void *update_measures(void *data)
static void indicators_update(struct ui_psensor *ui)
{
static void indicators_update(struct ui_psensor *ui)
{
- struct psensor **s
ensor_cur = ui->sensor
s;
-
unsigned int attention = 0
;
+ struct psensor **s
s, *
s;
+
bool attention
;
- while (*sensor_cur) {
- struct psensor *s = *sensor_cur;
+ attention = false;
+ ss = ui->sensors;
+ while (*ss) {
+ s = *ss;
- if (s->alarm_
enabled && s->alarm_raised
) {
- attention =
1
;
+ if (s->alarm_
raised && config_get_sensor_alarm_enabled(s->id)
) {
+ attention =
true
;
break;
}
break;
}
- s
ensor_cur
++;
+ s
s
++;
}
#if defined(HAVE_APPINDICATOR)
}
#if defined(HAVE_APPINDICATOR)
@@
-248,10
+250,10
@@
static gboolean ui_refresh_thread(gpointer data)
static void cb_alarm_raised(struct psensor *sensor, void *data)
{
static void cb_alarm_raised(struct psensor *sensor, void *data)
{
- if (
sensor->alarm_enabled)
+ if (
config_get_sensor_alarm_enabled(sensor->id)) {
ui_notify(sensor, (struct ui_psensor *)data);
ui_notify(sensor, (struct ui_psensor *)data);
-
- notify_cmd(sensor);
+ notify_cmd(sensor);
+ }
}
static void associate_colors(struct psensor **sensors)
}
static void associate_colors(struct psensor **sensors)
@@
-318,9
+320,6
@@
associate_cb_alarm_raised(struct psensor **sensors, struct ui_psensor *ui)
s->alarm_low_threshold
= config_get_sensor_alarm_low_threshold(s->id);
s->alarm_low_threshold
= config_get_sensor_alarm_low_threshold(s->id);
- s->alarm_enabled
- = config_get_sensor_alarm_enabled(s->id);
-
sensor_cur++;
}
}
sensor_cur++;
}
}