Code

use mpdclient_finish_command at the obvious places
[ncmpc.git] / src / conf.c
index ea35486b9f2f4d5dab630e782ae0de7c7bd23cc6..7fa2863c56776ff1abd17d23485629e121304c15 100644 (file)
@@ -69,7 +69,6 @@
 #define CONF_PORT "port"
 #define CONF_PASSWORD "password"
 #define CONF_LYRICS_TIMEOUT "lyrics-timeout"
-#define CONF_SHOW_SPLASH "show-splash"
 #define CONF_SCROLL "scroll"
 #define CONF_SCROLL_SEP "scroll-sep"
 #define CONF_VISIBLE_BITRATE "visible-bitrate"
@@ -77,6 +76,7 @@
 #define CONF_DISPLAY_TIME "display-time"
 #define CONF_JUMP_PREFIX_ONLY "jump-prefix-only"
 #define CONF_LYRICS_AUTOSAVE "lyrics-autosave"
+#define CONF_LYRICS_SHOW_PLUGIN "lyrics-show-plugin"
 #define CONF_SECOND_COLUMN "second-column"
 
 static bool
@@ -377,10 +377,8 @@ parse_line(char *line)
        bool match_found;
 
        /* get the name part */
-       while (i < len && line[i] != '=' &&
-              !g_ascii_isspace(line[i])) {
+       while (i < len && line[i] != '=' && !g_ascii_isspace(line[i]))
                name[j++] = line[i++];
-       }
 
        name[j] = '\0';
 
@@ -484,8 +482,6 @@ parse_line(char *line)
        else if (!strcasecmp(CONF_SCREEN_LIST, name)) {
                g_strfreev(options.screen_list);
                options.screen_list = check_screen_list(value);
-       } else if (!strcasecmp(CONF_SHOW_SPLASH, name)) {
-               /* the splash screen was removed */
        } else if (!strcasecmp(CONF_HOST, name))
                options.host = get_format(value);
        else if (!strcasecmp(CONF_PORT, name))
@@ -520,6 +516,12 @@ parse_line(char *line)
                options.lyrics_autosave = str2bool(value);
 #else
        {}
+#endif
+       else if (!strcasecmp(CONF_LYRICS_SHOW_PLUGIN, name))
+#ifdef ENABLE_LYRICS_SCREEN
+               options.lyrics_show_plugin = str2bool(value);
+#else
+               {}
 #endif
        else if (!strcasecmp(CONF_SECOND_COLUMN, name))
 #ifdef NCMPC_MINI
@@ -531,8 +533,7 @@ parse_line(char *line)
                match_found = false;
 
        if (!match_found)
-               print_error(_("Unknown configuration parameter"),
-                           name);
+               print_error(_("Unknown configuration parameter"), name);
 
        return match_found;
 }
@@ -574,7 +575,11 @@ check_user_conf_dir(void)
                return 0;
        }
 
+#ifndef WIN32
        retval = mkdir(directory, 0755);
+#else
+       retval = mkdir(directory);
+#endif
        g_free(directory);
        return retval;
 }