summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e67ad30)
raw | patch | inline | side by side (parent: e67ad30)
author | Paul Collins <paul@burly.ondioline.org> | |
Thu, 1 Jan 2009 21:54:04 +0000 (22:54 +0100) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 1 Jan 2009 21:54:04 +0000 (22:54 +0100) |
I already have a clock, and I don't need ncmpc showing me another one.
This patch adds command line options and a config file item to allow the
user to flexibly enable or disable the clock.
[mk: patch from http://bugs.debian.org/510392; removed command line
options]
This patch adds command line options and a config file item to allow the
user to flexibly enable or disable the clock.
[mk: patch from http://bugs.debian.org/510392; removed command line
options]
src/conf.c | patch | blob | history | |
src/options.c | patch | blob | history | |
src/options.h | patch | blob | history | |
src/screen.c | patch | blob | history |
diff --git a/src/conf.c b/src/conf.c
index 38d5089540e49369a25c97cca9c0030d11e95a63..67d048ae6972eb43dec841e85ef56d5e2e588e2d 100644 (file)
--- a/src/conf.c
+++ b/src/conf.c
#define CONF_SCROLL_SEP "scroll-sep"
#define CONF_VISIBLE_BITRATE "visible-bitrate"
#define CONF_WELCOME_SCREEN_LIST "welcome-screen-list"
+#define CONF_DISPLAY_TIME "display-time"
static bool
str2bool(char *str)
else if (!strcasecmp(CONF_SCROLL_SEP, name)) {
g_free(options.scroll_sep);
options.scroll_sep = get_format(value);
- } else
+ } else if (!strcasecmp(CONF_DISPLAY_TIME, name))
+#ifdef NCMPC_MINI
+ {}
+#else
+ options.display_time = str2bool(value);
+#endif
+ else
match_found = false;
if (!match_found)
diff --git a/src/options.c b/src/options.c
index 5bb5fbadd7f20fd652706c211bbc9e42aeb250de..3f784d11cc9c00ab23b84a1be23af8f7690790ba 100644 (file)
--- a/src/options.c
+++ b/src/options.c
#ifndef NCMPC_MINI
.scroll = DEFAULT_SCROLL,
.welcome_screen_list = true,
+ .display_time = true,
#endif
};
diff --git a/src/options.h b/src/options.h
index 671107a76dfe389504aae741581a0ae0eacfc97a..c48d1b39044ff2495d9d239c66e7902913dd54b7 100644 (file)
--- a/src/options.h
+++ b/src/options.h
bool scroll;
bool visible_bitrate;
bool welcome_screen_list;
+ bool display_time;
#endif
} options_t;
diff --git a/src/screen.c b/src/screen.c
index 1f44f73982a80a5eaa02a7635dd1e0c27c369f74..924cf4bd8149be56272366f0cdb9fc13734c081b 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
}
#ifndef NCMPC_MINI
} else {
- time_t timep;
+ if (options.display_time) {
+ time_t timep;
- time(&timep);
- strftime(screen.buf, screen.buf_size, "%X ",localtime(&timep));
+ time(&timep);
+ strftime(screen.buf, screen.buf_size, "%X ",localtime(&timep));
+ }
#endif
}