Imported Upstream version 1.2.0
[psensor-pkg-debian.git] / src / ui_notify.c
index f55821c..719f502 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2013 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
@@ -40,7 +40,7 @@ void ui_notify(struct psensor *sensor, struct ui_psensor *ui)
        char *body, *svalue;
        const char *summary;
        NotifyNotification *notif;
-       unsigned int use_celcius;
+       unsigned int use_celsius;
 
        log_debug("last_notification %d", last_notification_tv.tv_sec);
 
@@ -53,21 +53,21 @@ void ui_notify(struct psensor *sensor, struct ui_psensor *ui)
            || t.tv_sec - last_notification_tv.tv_sec >= 60)
                last_notification_tv = t;
        else
-               return ;
+               return;
 
        if (notify_is_initted() == FALSE)
                notify_init("psensor");
 
        if (notify_is_initted() == TRUE) {
-               if (ui->config->temperature_unit == CELCIUS)
-                       use_celcius = 1;
+               if (config_get_temperature_unit() == CELSIUS)
+                       use_celsius = 1;
                else
-                       use_celcius = 0;
+                       use_celsius = 0;
 
                svalue = psensor_measure_to_str
                        (psensor_get_current_measure(sensor),
                         sensor->type,
-                        use_celcius);
+                        use_celsius);
 
                body = malloc(strlen(sensor->name) + 3 + strlen(svalue) + 1);
                sprintf(body, "%s : %s", sensor->name, svalue);
@@ -75,8 +75,8 @@ void ui_notify(struct psensor *sensor, struct ui_psensor *ui)
 
                if (is_temp_type(sensor->type))
                        summary = _("Temperature alert");
-               else if (is_fan_type(sensor->type))
-                       summary = _("Fan alert");
+               else if (sensor->type & SENSOR_TYPE_RPM)
+                       summary = _("Fan speed alert");
                else
                        summary = _("N/A");