Commit 6229210d authored by Max Kellermann's avatar Max Kellermann

Main: move code to LoadConfigFile()

parent 5d0d5b5d
......@@ -591,18 +591,24 @@ MainConfigured(const CommandLineOptions &options,
#ifdef ANDROID
static void
LoadConfigFile(JNIEnv *env, ConfigData &config)
{
if (const auto dir = Environment::getExternalStorageDirectory(env);
!dir.IsNull()) {
const auto config_path =
dir / Path::FromFS("mpd.conf");
if (FileExists(config_path))
ReadConfigFile(config, config_path);
}
}
static void
AndroidMain(JNIEnv *env)
{
CommandLineOptions options;
ConfigData raw_config;
const auto sdcard = Environment::getExternalStorageDirectory(env);
if (!sdcard.IsNull()) {
const auto config_path =
sdcard / Path::FromFS("mpd.conf");
if (FileExists(config_path))
ReadConfigFile(raw_config, config_path);
}
LoadConfigFile(env, raw_config);
MainConfigured(options, raw_config);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment