PlaylistFile: use struct ConfigData

This commit is contained in:
Max Kellermann 2018-07-17 22:31:33 +02:00
parent ffe6819966
commit dd57b81989
3 changed files with 9 additions and 8 deletions

View File

@ -545,7 +545,7 @@ try {
glue_mapper_init(); glue_mapper_init();
initPermissions(); initPermissions();
spl_global_init(); spl_global_init(GetGlobalConfig());
#ifdef ENABLE_ARCHIVE #ifdef ENABLE_ARCHIVE
archive_plugin_init_all(); archive_plugin_init_all();
#endif #endif

View File

@ -29,7 +29,7 @@
#include "fs/io/TextFile.hxx" #include "fs/io/TextFile.hxx"
#include "fs/io/FileOutputStream.hxx" #include "fs/io/FileOutputStream.hxx"
#include "fs/io/BufferedOutputStream.hxx" #include "fs/io/BufferedOutputStream.hxx"
#include "config/Global.hxx" #include "config/Data.hxx"
#include "config/Option.hxx" #include "config/Option.hxx"
#include "config/Defaults.hxx" #include "config/Defaults.hxx"
#include "Idle.hxx" #include "Idle.hxx"
@ -55,15 +55,15 @@ static unsigned playlist_max_length;
bool playlist_saveAbsolutePaths = DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS; bool playlist_saveAbsolutePaths = DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS;
void void
spl_global_init(void) spl_global_init(const ConfigData &config)
{ {
playlist_max_length = playlist_max_length =
config_get_positive(ConfigOption::MAX_PLAYLIST_LENGTH, config.GetPositive(ConfigOption::MAX_PLAYLIST_LENGTH,
DEFAULT_PLAYLIST_MAX_LENGTH); DEFAULT_PLAYLIST_MAX_LENGTH);
playlist_saveAbsolutePaths = playlist_saveAbsolutePaths =
config_get_bool(ConfigOption::SAVE_ABSOLUTE_PATHS, config.GetBool(ConfigOption::SAVE_ABSOLUTE_PATHS,
DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS); DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS);
} }
bool bool

View File

@ -23,6 +23,7 @@
#include <vector> #include <vector>
#include <string> #include <string>
struct ConfigData;
class DetachedSong; class DetachedSong;
class SongLoader; class SongLoader;
class PlaylistVector; class PlaylistVector;
@ -36,7 +37,7 @@ extern bool playlist_saveAbsolutePaths;
* Perform some global initialization, e.g. load configuration values. * Perform some global initialization, e.g. load configuration values.
*/ */
void void
spl_global_init(); spl_global_init(const ConfigData &config);
/** /**
* Determines whether the specified string is a valid name for a * Determines whether the specified string is a valid name for a