diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2021-11-22 03:40:31 +0100 |
|---|---|---|
| committer | Admiral H. Curtiss <pikachu025@gmail.com> | 2021-12-25 20:21:32 +0100 |
| commit | ab56f3ecbddb85635b52219b0a1f37beec40aadc (patch) | |
| tree | b50ca643258d87881d49cff082c5af905f0faed6 | |
| parent | e54657254a92d5cc9b2620abba347e437dcab6dc (diff) | |
Calls to File::SetUserPath() no longer need to manually append directory separators.
| -rw-r--r-- | Source/Android/jni/MainAndroid.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/UICommon/UICommon.cpp | 17 |
2 files changed, 5 insertions, 14 deletions
diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index 4b94996796..4b2e6f5358 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -387,7 +387,7 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetCacheDire JNIEnv* env, jclass, jstring jDirectory) { std::lock_guard<std::mutex> guard(s_host_identity_lock); - File::SetUserPath(D_CACHE_IDX, GetJString(env, jDirectory) + DIR_SEP); + File::SetUserPath(D_CACHE_IDX, GetJString(env, jDirectory)); } JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_DefaultCPUCore(JNIEnv*, jclass) diff --git a/Source/Core/UICommon/UICommon.cpp b/Source/Core/UICommon/UICommon.cpp index 3f7949d7f8..8bad3e60d8 100644 --- a/Source/Core/UICommon/UICommon.cpp +++ b/Source/Core/UICommon/UICommon.cpp @@ -54,7 +54,7 @@ namespace UICommon static void CreateDumpPath(const std::string& path) { if (!path.empty()) - File::SetUserPath(D_DUMP_IDX, path + '/'); + File::SetUserPath(D_DUMP_IDX, path); File::CreateFullPath(File::GetUserPath(D_DUMPAUDIO_IDX)); File::CreateFullPath(File::GetUserPath(D_DUMPDSP_IDX)); File::CreateFullPath(File::GetUserPath(D_DUMPSSL_IDX)); @@ -66,7 +66,7 @@ static void CreateDumpPath(const std::string& path) static void CreateLoadPath(const std::string& path) { if (!path.empty()) - File::SetUserPath(D_LOAD_IDX, path + '/'); + File::SetUserPath(D_LOAD_IDX, path); File::CreateFullPath(File::GetUserPath(D_HIRESTEXTURES_IDX)); File::CreateFullPath(File::GetUserPath(D_RIIVOLUTION_IDX)); } @@ -74,7 +74,7 @@ static void CreateLoadPath(const std::string& path) static void CreateResourcePackPath(const std::string& path) { if (!path.empty()) - File::SetUserPath(D_RESOURCEPACK_IDX, path + '/'); + File::SetUserPath(D_RESOURCEPACK_IDX, path); } static void CreateWFSPath(const std::string& path) @@ -217,7 +217,7 @@ void SetUserDirectory(const std::string& custom_path) if (!custom_path.empty()) { File::CreateFullPath(custom_path + DIR_SEP); - File::SetUserPath(D_USER_IDX, custom_path + DIR_SEP); + File::SetUserPath(D_USER_IDX, custom_path); return; } @@ -281,15 +281,6 @@ void SetUserDirectory(const std::string& custom_path) user_path = File::GetExeDirectory() + DIR_SEP USERDATA_DIR DIR_SEP; CoTaskMemFree(my_documents); - - // Prettify the path: it will be displayed in some places, we don't want a mix - // of \ and /. - user_path = ReplaceAll(std::move(user_path), "\\", DIR_SEP); - - // Make sure it ends in DIR_SEP. - if (user_path.back() != DIR_SEP_CHR) - user_path += DIR_SEP; - #else if (File::IsDirectory(ROOT_DIR DIR_SEP USERDATA_DIR)) { |
