Code

status_bar: remove the status bar clock (option "display-time")
authorMax Kellermann <max.kellermann@gmail.com>
Mon, 20 Mar 2017 15:47:59 +0000 (16:47 +0100)
committerMax Kellermann <max.kellermann@gmail.com>
Mon, 20 Mar 2017 15:47:59 +0000 (16:47 +0100)
This is a pretty useless feature which is only available when not
playing something - a state in which ncmpc isn't useful either.  What
the clock does is require a timer which wakes up ncmpc every second,
when it should better be completely idle (and swapped out).

NEWS
doc/config.sample
src/conf.c
src/main.c
src/options.h
src/status_bar.c

diff --git a/NEWS b/NEWS
index 5aad8b5e8cca98b4e4379675f1363f6bcc9401e5..2e36c8abe327e50f6c185c13f2fcc7611db9584d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,5 @@
 ncmpc 0.27 - not yet released
+* remove the status bar clock (option "display-time")
 
 ncmpc 0.26 - (2017-03-20)
 * require libmpdclient 2.9
index 1b40092e01e4461fcad9b219c81c8430ff08f0bc..499754e806180bbfc3a34d6e6b3b43b05dfff015 100644 (file)
@@ -88,9 +88,6 @@
 ## The time, in seconds, for which status messages will be displayed.
 #status-message-time = 3
 
-## Display the time in the status bar when idle.
-#display-time = yes
-
 ## Sets whether to display remaining or elapsed time in
 ## the status window. Default is elapsed.
 #timedisplay-type = elapsed
index 652628c3c3bbe616a07de240a7798db0ff1c8d48..814a13b774486e2e204ee1d8bc61aba2ea12f8c6 100644 (file)
@@ -501,11 +501,8 @@ parse_line(char *line)
                g_free(options.scroll_sep);
                options.scroll_sep = get_format(value);
        } else if (!strcasecmp(CONF_DISPLAY_TIME, name))
-#ifdef NCMPC_MINI
+               /* obsolete, ignore */
                {}
-#else
-               options.display_time = str2bool(value);
-#endif
        else if (!strcasecmp(CONF_JUMP_PREFIX_ONLY, name))
 #ifdef NCMPC_MINI
                {}
index 8bfa03a86cff4bc8c0e9e06a55f7660b13159bf1..0729610a54ad7336e0347efb12154e9187d764d3 100644 (file)
@@ -114,11 +114,7 @@ disable_update_timer(void)
 static bool
 should_enable_update_timer(void)
 {
-       return mpd->playing
-#ifndef NCMPC_MINI
-               || options.display_time
-#endif
-               ;
+       return mpd->playing;
 }
 
 static void
index aa31a9fa76a6e03695f6407c69a109e4f348b294..de7c24ca41b1107a263e3c16368cdce7dbc55fc5 100644 (file)
@@ -81,7 +81,6 @@ typedef struct {
        bool scroll;
        bool visible_bitrate;
        bool welcome_screen_list;
-       bool display_time;
        bool jump_prefix_only;
        bool second_column;
 #endif
index ef25707ad202e020912294e3163d9bcd9042fff1..74f91de3a67a75baa121960e8f928484c9934714 100644 (file)
@@ -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 */