diff options
author | Max Kellermann <max@musicpd.org> | 2018-08-19 22:41:08 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-08-19 22:41:08 +0200 |
commit | 80839b537279fb4780d14a4094b4c2322a5e50c2 (patch) | |
tree | e8c595f43b4a66ac77bb8148e6f692c3443532bf /test | |
parent | dafa3f985a1aaafde6fa5f7e9d3277b21521b37b (diff) |
test/run_input: allocate ConfigData in class GlobalInit
Diffstat (limited to 'test')
-rw-r--r-- | test/run_input.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/test/run_input.cxx b/test/run_input.cxx index a058a1d8d..92573eda7 100644 --- a/test/run_input.cxx +++ b/test/run_input.cxx @@ -20,7 +20,9 @@ #include "config.h" #include "TagSave.hxx" #include "tag/Tag.hxx" -#include "config/Global.hxx" +#include "config/File.hxx" +#include "config/Migrate.hxx" +#include "config/Data.hxx" #include "input/InputStream.hxx" #include "input/Init.hxx" #include "input/Registry.hxx" @@ -101,22 +103,24 @@ ParseCommandLine(int argc, char **argv) } class GlobalInit { + ConfigData config; EventThread io_thread; public: GlobalInit(Path config_path, bool verbose) { SetLogThreshold(verbose ? LogLevel::DEBUG : LogLevel::INFO); - io_thread.Start(); - config_global_init(); + if (!config_path.IsNull()) { + ReadConfigFile(config, config_path); + Migrate(config); + } - if (!config_path.IsNull()) - ReadConfigFile(config_path); + io_thread.Start(); #ifdef ENABLE_ARCHIVE archive_plugin_init_all(); #endif - input_stream_global_init(GetGlobalConfig(), + input_stream_global_init(config, io_thread.GetEventLoop()); } @@ -125,7 +129,6 @@ public: #ifdef ENABLE_ARCHIVE archive_plugin_deinit_all(); #endif - config_global_finish(); } }; |