avoid to computer the max temperature if the launcher counter is not enabled.
[psensor.git] / src / ui_unity.c
index 0ab2e12..2b949c8 100644 (file)
@@ -72,12 +72,14 @@ void ui_unity_launcher_entry_update(struct psensor **sensors,
                last_visible = show;
        }
 
-       if (sensors && *sensors) {
+       if (show && sensors && *sensors) {
                v = get_max_current_value(sensors, SENSOR_TYPE_TEMP);
 
-               if (!use_celsius)
-                       v = celsius_to_fahrenheit(v);
+               if (v != UNKNOWN_DBL_VALUE) {
+                       if (!use_celsius)
+                               v = celsius_to_fahrenheit(v);
 
-               unity_launcher_entry_set_count(psensor_entry, v);
+                       unity_launcher_entry_set_count(psensor_entry, v);
+               }
        }
 }