diff options
author | Max Kellermann <max@musicpd.org> | 2018-07-17 22:31:33 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-07-17 22:31:33 +0200 |
commit | dd57b81989a1f7622aa5017e1edf86070fd3b061 (patch) | |
tree | 347471c7647bc5e2541f17d8494f644c172b6300 | |
parent | ffe6819966ea8adeb743e12324807983b22e2b9b (diff) |
PlaylistFile: use struct ConfigData
-rw-r--r-- | src/Main.cxx | 2 | ||||
-rw-r--r-- | src/PlaylistFile.cxx | 12 | ||||
-rw-r--r-- | src/PlaylistFile.hxx | 3 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/Main.cxx b/src/Main.cxx index caad35cc6..40d7ef895 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -545,7 +545,7 @@ try { glue_mapper_init(); initPermissions(); - spl_global_init(); + spl_global_init(GetGlobalConfig()); #ifdef ENABLE_ARCHIVE archive_plugin_init_all(); #endif diff --git a/src/PlaylistFile.cxx b/src/PlaylistFile.cxx index a1b83eb41..4de73df30 100644 --- a/src/PlaylistFile.cxx +++ b/src/PlaylistFile.cxx @@ -29,7 +29,7 @@ #include "fs/io/TextFile.hxx" #include "fs/io/FileOutputStream.hxx" #include "fs/io/BufferedOutputStream.hxx" -#include "config/Global.hxx" +#include "config/Data.hxx" #include "config/Option.hxx" #include "config/Defaults.hxx" #include "Idle.hxx" @@ -55,15 +55,15 @@ static unsigned playlist_max_length; bool playlist_saveAbsolutePaths = DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS; void -spl_global_init(void) +spl_global_init(const ConfigData &config) { playlist_max_length = - config_get_positive(ConfigOption::MAX_PLAYLIST_LENGTH, - DEFAULT_PLAYLIST_MAX_LENGTH); + config.GetPositive(ConfigOption::MAX_PLAYLIST_LENGTH, + DEFAULT_PLAYLIST_MAX_LENGTH); playlist_saveAbsolutePaths = - config_get_bool(ConfigOption::SAVE_ABSOLUTE_PATHS, - DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS); + config.GetBool(ConfigOption::SAVE_ABSOLUTE_PATHS, + DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS); } bool diff --git a/src/PlaylistFile.hxx b/src/PlaylistFile.hxx index 89c6a48d3..ff76a3d03 100644 --- a/src/PlaylistFile.hxx +++ b/src/PlaylistFile.hxx @@ -23,6 +23,7 @@ #include <vector> #include <string> +struct ConfigData; class DetachedSong; class SongLoader; class PlaylistVector; @@ -36,7 +37,7 @@ extern bool playlist_saveAbsolutePaths; * Perform some global initialization, e.g. load configuration values. */ void -spl_global_init(); +spl_global_init(const ConfigData &config); /** * Determines whether the specified string is a valid name for a |