Fix: If there is no battery then we don't care about the status
authorNikolas Garofil <garo@dunaldi.garofil.be>
Mon, 27 Jul 2009 11:34:20 +0000 (13:34 +0200)
committerNikolas Garofil <garo@dunaldi.garofil.be>
Mon, 27 Jul 2009 11:34:20 +0000 (13:34 +0200)
src/conky.c
src/conky.h

index bf656a3..c36fbcf 100644 (file)
@@ -7138,7 +7138,7 @@ static void main_loop(void)
        next_update_time = get_time();
        info.looped = 0;
        while (terminate == 0 && (total_run_times == 0 || info.looped < total_run_times)) {
-               if(update_interval_bat != update_interval_old) {
+               if(update_interval_bat != NOBATTERY && update_interval_bat != update_interval_old) {
                        char buf[max_user_text];
 
                        get_battery_short_status(buf, max_user_text, "BAT0");
@@ -7888,7 +7888,7 @@ static void set_default_configurations(void)
        no_buffers = 1;
        update_interval = 3.0;
        update_interval_old = update_interval;
-       update_interval_bat = update_interval;
+       update_interval_bat = NOBATTERY;
        info.music_player_interval = 1.0;
        stuff_in_uppercase = 0;
        info.users.number = 1;
index 8ed78b2..1193a7c 100644 (file)
@@ -374,4 +374,6 @@ extern enum x_initialiser_state x_initialised;
 
 #define DEFAULT_TEXT_BUFFER_SIZE_S "##DEFAULT_TEXT_BUFFER_SIZE"
 
+#define NOBATTERY 0
+
 #endif /* _conky_h_ */