MCPcopy Create free account
hub / github.com/MusicPlayerDaemon/MPD / LoadConfigFile

Function LoadConfigFile

src/Main.cxx:551–568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

549}
550
551static void
552LoadConfigFile(JNIEnv *env, ConfigData &config)
553{
554 /* try loading mpd.conf from
555 "Android/data/org.musicpd/files/mpd.conf" (the app specific
556 data directory) first */
557 if (const auto dir = context->GetExternalFilesDir(env);
558 !dir.IsNull() &&
559 TryReadConfigFile(config, dir / Path::FromFS("mpd.conf")))
560 return;
561
562 /* if that fails, attempt to load "mpd.conf" from the root of
563 the SD card (pre-0.23.9, ceases to work since Android
564 12) */
565 if (const auto dir = Environment::getExternalStorageDirectory(env);
566 !dir.IsNull())
567 TryReadConfigFile(config, dir / Path::FromFS("mpd.conf"));
568}
569
570static void
571AndroidMain(JNIEnv *env)

Callers 1

AndroidMainFunction · 0.85

Calls 3

TryReadConfigFileFunction · 0.85
GetExternalFilesDirMethod · 0.80

Tested by

no test coverage detected