summaryrefslogtreecommitdiffstats
path: root/src/android/app
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2024-01-04 21:51:24 +0100
committerGitHub <noreply@github.com>2024-01-04 21:51:24 +0100
commita8f62bff4364b906076dcc4d1306d2f6fe83fc74 (patch)
treed68ec1701f88a720c36ddf3304e9f309d9fee8c9 /src/android/app
parentMerge pull request #12571 from t895/apply-orientation-on-start (diff)
parentandroid: Save global config synchronously in onCloseGameFoldersFragment (diff)
downloadyuzu-a8f62bff4364b906076dcc4d1306d2f6fe83fc74.tar
yuzu-a8f62bff4364b906076dcc4d1306d2f6fe83fc74.tar.gz
yuzu-a8f62bff4364b906076dcc4d1306d2f6fe83fc74.tar.bz2
yuzu-a8f62bff4364b906076dcc4d1306d2f6fe83fc74.tar.lz
yuzu-a8f62bff4364b906076dcc4d1306d2f6fe83fc74.tar.xz
yuzu-a8f62bff4364b906076dcc4d1306d2f6fe83fc74.tar.zst
yuzu-a8f62bff4364b906076dcc4d1306d2f6fe83fc74.zip
Diffstat (limited to 'src/android/app')
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/model/GamesViewModel.kt5
-rw-r--r--src/android/app/src/main/jni/android_config.cpp6
-rw-r--r--src/android/app/src/main/jni/android_config.h1
3 files changed, 3 insertions, 9 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/GamesViewModel.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/GamesViewModel.kt
index d19f20dc2..5ae05b5cc 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/GamesViewModel.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/model/GamesViewModel.kt
@@ -167,13 +167,14 @@ class GamesViewModel : ViewModel() {
}
}
- fun onCloseGameFoldersFragment() =
+ fun onCloseGameFoldersFragment() {
+ NativeConfig.saveGlobalConfig()
viewModelScope.launch {
withContext(Dispatchers.IO) {
- NativeConfig.saveGlobalConfig()
getGameDirs(true)
}
}
+ }
private fun getGameDirs(reloadList: Boolean = false) {
val gameDirs = NativeConfig.getGameDirs()
diff --git a/src/android/app/src/main/jni/android_config.cpp b/src/android/app/src/main/jni/android_config.cpp
index c86aa1c39..08aed3216 100644
--- a/src/android/app/src/main/jni/android_config.cpp
+++ b/src/android/app/src/main/jni/android_config.cpp
@@ -14,12 +14,6 @@ AndroidConfig::AndroidConfig(const std::string& config_name, ConfigType config_t
}
}
-AndroidConfig::~AndroidConfig() {
- if (global) {
- AndroidConfig::SaveAllValues();
- }
-}
-
void AndroidConfig::ReloadAllValues() {
Reload();
ReadAndroidValues();
diff --git a/src/android/app/src/main/jni/android_config.h b/src/android/app/src/main/jni/android_config.h
index d83852de9..693e1e3f0 100644
--- a/src/android/app/src/main/jni/android_config.h
+++ b/src/android/app/src/main/jni/android_config.h
@@ -9,7 +9,6 @@ class AndroidConfig final : public Config {
public:
explicit AndroidConfig(const std::string& config_name = "config",
ConfigType config_type = ConfigType::GlobalConfig);
- ~AndroidConfig() override;
void ReloadAllValues() override;
void SaveAllValues() override;