From b543b982624593ab767d0734b08d053662434380 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 2 Oct 2008 16:15:56 +0200 Subject: [PATCH] options: initialize options.list_format Instead of checking whether options.list_format is set in the LIST_FORMAT macro, initialize it once with options.list_format. Same for options.status_format / STATUS_FORMAT. --- src/ncmpc.h | 8 +++----- src/options.c | 2 ++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ncmpc.h b/src/ncmpc.h index ad6a6e3..746bc8b 100644 --- a/src/ncmpc.h +++ b/src/ncmpc.h @@ -47,14 +47,12 @@ /* song format - list window */ #define DEFAULT_LIST_FORMAT "%name%|[%artist% - ]%title%|%shortfile%" -#define LIST_FORMAT (options.list_format ? options.list_format : \ - DEFAULT_LIST_FORMAT) +#define LIST_FORMAT options.list_format /* song format - status window */ #define DEFAULT_STATUS_FORMAT "[%artist% - ]%title%|%shortfile%" -#define STATUS_FORMAT (options.status_format ? options.status_format : \ - DEFAULT_STATUS_FORMAT) - +#define STATUS_FORMAT options.status_format + #define DEFAULT_LYRICS_TIMEOUT 100 #define DEFAULT_SCROLL TRUE diff --git a/src/options.c b/src/options.c index 5b2b47c..f6e206a 100644 --- a/src/options.c +++ b/src/options.c @@ -333,6 +333,8 @@ options_init( void ) options.port = DEFAULT_PORT; /* default option values */ + options.list_format = g_strdup(DEFAULT_LIST_FORMAT); + options.status_format = g_strdup(DEFAULT_STATUS_FORMAT); options.reconnect = TRUE; options.find_wrap = TRUE; options.wide_cursor = TRUE; -- 2.30.2