Main: move code to LoadConfigFile()
This commit is contained in:
parent
5d0d5b5d97
commit
6229210d51
20
src/Main.cxx
20
src/Main.cxx
|
@ -590,19 +590,25 @@ 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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue