From: Max Kellermann Date: Thu, 2 Oct 2008 14:15:56 +0000 (+0200) Subject: options: initialize options.list_format X-Git-Tag: v0.12_alpha1~113 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b543b982624593ab767d0734b08d053662434380;p=ncmpc.git 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. --- 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;