Code

utils: move format_duration_*() to time_format.c
[ncmpc.git] / src / status_bar.c
index 2294fe1e9230291d38acf9c8921d1739b076c072..fc63d20e49e0d4fa4b50df1e5ac9b63e9da523db 100644 (file)
@@ -1,5 +1,5 @@
 /* ncmpc (Ncurses MPD Client)
- * (c) 2004-2010 The Music Player Daemon Project
+ * (c) 2004-2017 The Music Player Daemon Project
  * Project homepage: http://musicpd.org
  *
  * This program is free software; you can redistribute it and/or modify
@@ -24,7 +24,7 @@
 #include "charset.h"
 #include "strfsong.h"
 #include "player_command.h"
-#include "utils.h"
+#include "time_format.h"
 
 #include <mpd/client.h>
 
@@ -178,15 +178,7 @@ status_bar_paint(struct status_bar *p, const struct mpd_status *status,
 #endif
                }
        } else {
-#ifndef NCMPC_MINI
-               if (options.display_time) {
-                       time_t timep;
-
-                       time(&timep);
-                       strftime(buffer, sizeof(buffer), "%X ",localtime(&timep));
-               } else
-#endif
-                       buffer[0] = 0;
+               buffer[0] = 0;
        }
 
        /* display song */
@@ -269,6 +261,6 @@ status_bar_message(struct status_bar *p, const char *msg)
 
        if (p->message_source_id != 0)
                g_source_remove(p->message_source_id);
-       p->message_source_id = g_timeout_add(options.status_message_time * 1000,
-                                            status_bar_clear_message_cb, p);
+       p->message_source_id = g_timeout_add_seconds(options.status_message_time,
+                                                    status_bar_clear_message_cb, p);
 }