Merge pull request #9454 from JosJuice/android-ingame-settings-save

Android: Fix in-game settings changes not getting saved
This commit is contained in:
Léo Lam 2021-01-27 18:17:27 +01:00 committed by GitHub
commit 70447d0281
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -128,7 +128,12 @@ Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_unloadGameIn
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_save( JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_save(
JNIEnv*, jclass, jint layer) JNIEnv*, jclass, jint layer)
{ {
return GetLayer(layer, {})->Save(); 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 layer_ptr->Save();
} }
JNIEXPORT jboolean JNICALL JNIEXPORT jboolean JNICALL

View File

@ -138,6 +138,8 @@ public:
m_map.insert_or_assign(location, std::move(new_value)); m_map.insert_or_assign(location, std::move(new_value));
} }
void MarkAsDirty() { m_is_dirty = true; }
Section GetSection(System system, const std::string& section); Section GetSection(System system, const std::string& section);
ConstSection GetSection(System system, const std::string& section) const; ConstSection GetSection(System system, const std::string& section) const;