diff options
| author | Mai <mai.iam2048@gmail.com> | 2024-02-05 09:47:08 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-05 09:47:08 -0500 |
| commit | 9240f579eab18a2f67eef23846a6b508393d0e6c (patch) | |
| tree | 80aea0c56b0108e60c0f791713be0960e490b407 /Source/Android | |
| parent | abbc4bd0bdff1a792bc0f6e912a022c17bd8668a (diff) | |
| parent | 1315b54ffaa2833ddda7e543945c88ed5396efd6 (diff) | |
Merge pull request #12561 from JosJuice/profile-consistency
InputCommon: Fix profile path inconsistencies
Diffstat (limited to 'Source/Android')
4 files changed, 27 insertions, 7 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/controlleremu/EmulatedController.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/controlleremu/EmulatedController.kt index e84dd201a5..4b2c6ec92c 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/controlleremu/EmulatedController.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/model/controlleremu/EmulatedController.kt @@ -30,7 +30,11 @@ class EmulatedController private constructor(private val pointer: Long) { external fun saveProfile(path: String) - external fun getProfileName(): String + external fun getProfileKey(): String + + external fun getUserProfileDirectoryPath(): String + + external fun getSysProfileDirectoryPath(): String companion object { @JvmStatic diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/ui/ProfileDialogPresenter.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/ui/ProfileDialogPresenter.kt index 2896c815fe..5c0a50a8b8 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/ui/ProfileDialogPresenter.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/input/ui/ProfileDialogPresenter.kt @@ -101,11 +101,11 @@ class ProfileDialogPresenter { } private fun getProfileDirectoryPath(stock: Boolean): String { - val profileDirectoryName = menuTag.correspondingEmulatedController.getProfileName() + val controller = menuTag.correspondingEmulatedController return if (stock) { - "${DirectoryInitialization.getSysDirectory()}/Profiles/$profileDirectoryName/" + controller.getSysProfileDirectoryPath() } else { - "${DirectoryInitialization.getUserDirectory()}/Config/Profiles/$profileDirectoryName/" + controller.getUserProfileDirectoryPath() } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.kt index 1051f445ae..44e2b2b915 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.kt +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.kt @@ -2237,7 +2237,7 @@ class SettingsFragmentPresenter( controllerNumber: Int ) { val profiles = ProfileDialogPresenter(menuTag).getProfileNames(false) - val profileKey = controller.getProfileName() + "Profile" + (controllerNumber + 1) + val profileKey = controller.getProfileKey() + "Profile" + (controllerNumber + 1) sl.add( StringSingleChoiceSetting( context, diff --git a/Source/Android/jni/Input/EmulatedController.cpp b/Source/Android/jni/Input/EmulatedController.cpp index c1dfd7ce5d..8a76240dfd 100644 --- a/Source/Android/jni/Input/EmulatedController.cpp +++ b/Source/Android/jni/Input/EmulatedController.cpp @@ -126,10 +126,26 @@ Java_org_dolphinemu_dolphinemu_features_input_model_controlleremu_EmulatedContro } JNIEXPORT jstring JNICALL -Java_org_dolphinemu_dolphinemu_features_input_model_controlleremu_EmulatedController_getProfileName( +Java_org_dolphinemu_dolphinemu_features_input_model_controlleremu_EmulatedController_getProfileKey( JNIEnv* env, jobject obj) { - return ToJString(env, EmulatedControllerFromJava(env, obj)->GetConfig()->GetProfileName()); + return ToJString(env, EmulatedControllerFromJava(env, obj)->GetConfig()->GetProfileKey()); +} + +JNIEXPORT jstring JNICALL +Java_org_dolphinemu_dolphinemu_features_input_model_controlleremu_EmulatedController_getUserProfileDirectoryPath( + JNIEnv* env, jobject obj) +{ + return ToJString( + env, EmulatedControllerFromJava(env, obj)->GetConfig()->GetUserProfileDirectoryPath()); +} + +JNIEXPORT jstring JNICALL +Java_org_dolphinemu_dolphinemu_features_input_model_controlleremu_EmulatedController_getSysProfileDirectoryPath( + JNIEnv* env, jobject obj) +{ + return ToJString(env, + EmulatedControllerFromJava(env, obj)->GetConfig()->GetSysProfileDirectoryPath()); } JNIEXPORT jobject JNICALL |
