/*
- * Copyright (C) 2010-2014 jeanfi@gmail.com
+ * Copyright (C) 2010-2016 jeanfi@gmail.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
const char *name;
struct psensor **sorted_sensors;
- celsius = ui->config->temperature_unit == CELSIUS;
+ if (config_get_temperature_unit() == CELSIUS)
+ celsius = 1;
+ else
+ celsius = 0;
sorted_sensors = ui_get_sensors_ordered_by_position(ui->sensors);
n = psensor_list_size(sorted_sensors);
{
char *label, *str, *tmp, *guide;
struct psensor **p;
+ int use_celsius;
p = ui_get_sensors_ordered_by_position(ui->sensors);
label = NULL;
guide = NULL;
+
+ if (config_get_temperature_unit() == CELSIUS)
+ use_celsius = 1;
+ else
+ use_celsius = 0;
+
while (*p) {
if (config_is_appindicator_label_enabled((*p)->id)) {
- str = psensor_current_value_to_str
- (*p, ui->config->temperature_unit == CELSIUS);
+ str = psensor_current_value_to_str(*p, use_celsius);
if (label == NULL) {
label = str;
app_indicator_set_status(indicator,
APP_INDICATOR_STATUS_ATTENTION);
- update_menu_items(ui->config->temperature_unit == CELSIUS);
+ if (config_get_temperature_unit() == CELSIUS)
+ update_menu_items(1);
+ else
+ update_menu_items(0);
}
static GtkStatusIcon *unity_fallback(AppIndicator *indicator)