diff options
| author | Mai <mai.iam2048@gmail.com> | 2023-03-14 15:48:04 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-14 15:48:04 -0400 |
| commit | 4281606838c705f81022348eaa5b001e577436a4 (patch) | |
| tree | 7008898e4b289546e97b930b9ee0778954aaffb6 /Source/Android/jni/Config/NativeConfig.cpp | |
| parent | e83b6e19ab425a3d92fc705e8153baa0c628a744 (diff) | |
| parent | 08334015f91a42a233bc35823de2af89e49e0b59 (diff) | |
Merge pull request #11641 from JosJuice/android-remove-old-config
Android: Remove support for the old config system
Diffstat (limited to 'Source/Android/jni/Config/NativeConfig.cpp')
| -rw-r--r-- | Source/Android/jni/Config/NativeConfig.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/Source/Android/jni/Config/NativeConfig.cpp b/Source/Android/jni/Config/NativeConfig.cpp index f707e91f5b..9681f0ca8e 100644 --- a/Source/Android/jni/Config/NativeConfig.cpp +++ b/Source/Android/jni/Config/NativeConfig.cpp @@ -43,6 +43,10 @@ static Config::Location GetLocation(JNIEnv* env, jstring file, jstring section, { system = Config::System::WiiPad; } + else if (decoded_file == "GameSettingsOnly") + { + system = Config::System::GameSettingsOnly; + } else { ASSERT(false); @@ -134,12 +138,14 @@ Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_unloadGameIn JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_save( JNIEnv*, jclass, jint layer) { - const std::shared_ptr<Config::Layer> layer_ptr = GetLayer(layer, {}); - - // Workaround for the Settings class carrying around a legacy map of settings it always saves - layer_ptr->MarkAsDirty(); + return GetLayer(layer, {})->Save(); +} - return layer_ptr->Save(); +JNIEXPORT void JNICALL +Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_deleteAllKeys(JNIEnv*, jclass, + jint layer) +{ + return GetLayer(layer, {})->DeleteAllKeys(); } JNIEXPORT jboolean JNICALL @@ -162,6 +168,16 @@ Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_deleteKey( return static_cast<jboolean>(had_value); } +JNIEXPORT jboolean JNICALL +Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_exists(JNIEnv* env, jclass, + jint layer, jstring file, + jstring section, + jstring key) +{ + const Config::Location location = GetLocation(env, file, section, key); + return static_cast<jboolean>(GetLayer(layer, location)->Exists(location)); +} + JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_getString( JNIEnv* env, jclass, jint layer, jstring file, jstring section, jstring key, |
