summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3647097)
raw | patch | inline | side by side (parent: 3647097)
author | Max Kellermann <max@duempel.org> | |
Thu, 2 Oct 2008 14:15:56 +0000 (16:15 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 2 Oct 2008 14:15:56 +0000 (16:15 +0200) |
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.
LIST_FORMAT macro, initialize it once with options.list_format. Same
for options.status_format / STATUS_FORMAT.
src/ncmpc.h | patch | blob | history | |
src/options.c | patch | blob | history |
diff --git a/src/ncmpc.h b/src/ncmpc.h
index ad6a6e302f80f681e5efdc35a43e20f6885b3cd8..746bc8beb7cb7d6b37ca8106ce398d28609f19e7 100644 (file)
--- a/src/ncmpc.h
+++ b/src/ncmpc.h
/* 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 5b2b47c478fc93be5bf3d9c905b264eb4b8c4fc5..f6e206aeabf82225a7493bb0d776b0660bc94d4f 100644 (file)
--- a/src/options.c
+++ b/src/options.c
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;