summaryrefslogtreecommitdiff
path: root/src/common/fs/path_util.cpp
diff options
context:
space:
mode:
authorGravatar boludoz2023-10-16 03:26:40 -0300
committerGravatar boludoz2023-10-16 03:26:40 -0300
commit26417da5d36ea5aae4410a5c35405e27f39661d2 (patch)
tree52389e95589cf6ec21a62495093691498c470815 /src/common/fs/path_util.cpp
parentLess code, simpler, better. (diff)
downloadyuzu-26417da5d36ea5aae4410a5c35405e27f39661d2.tar.gz
yuzu-26417da5d36ea5aae4410a5c35405e27f39661d2.tar.xz
yuzu-26417da5d36ea5aae4410a5c35405e27f39661d2.zip
Some improvements (suggestions)
Diffstat (limited to 'src/common/fs/path_util.cpp')
-rw-r--r--src/common/fs/path_util.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp
index 3d88fcf4f..bcd64156e 100644
--- a/src/common/fs/path_util.cpp
+++ b/src/common/fs/path_util.cpp
@@ -254,11 +254,8 @@ fs::path GetExeDirectory() {
254 WCHAR exe_path[MAX_PATH]; 254 WCHAR exe_path[MAX_PATH];
255 255
256 if (SUCCEEDED(GetModuleFileNameW(nullptr, exe_path, MAX_PATH))) { 256 if (SUCCEEDED(GetModuleFileNameW(nullptr, exe_path, MAX_PATH))) {
257 std::wstring wideExePath(exe_path); 257 std::wstring wide_exe_path(exe_path);
258 258 return fs::path{Common::UTF16ToUTF8(wide_exe_path)}.parent_path();
259 // UTF-16 filesystem lib to UTF-8 is broken, so we need to convert to UTF-8 with the with
260 // the Windows library (Filesystem converts the strings literally).
261 return fs::path{Common::UTF16ToUTF8(wideExePath)}.parent_path();
262 } else { 259 } else {
263 LOG_ERROR(Common_Filesystem, "Failed to get the path to the executable of the current " 260 LOG_ERROR(Common_Filesystem, "Failed to get the path to the executable of the current "
264 "process"); 261 "process");
@@ -273,9 +270,6 @@ fs::path GetAppDataRoamingDirectory() {
273 if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_RoamingAppData, 0, NULL, &appdata_roaming_path))) { 270 if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_RoamingAppData, 0, NULL, &appdata_roaming_path))) {
274 std::wstring wideAppdataRoamingPath(appdata_roaming_path); 271 std::wstring wideAppdataRoamingPath(appdata_roaming_path);
275 CoTaskMemFree(appdata_roaming_path); 272 CoTaskMemFree(appdata_roaming_path);
276
277 // UTF-16 filesystem lib to UTF-8 is broken, so we need to convert to UTF-8 with the with
278 // the Windows library (Filesystem converts the strings literally).
279 return fs::path{Common::UTF16ToUTF8(wideAppdataRoamingPath)}; 273 return fs::path{Common::UTF16ToUTF8(wideAppdataRoamingPath)};
280 } else { 274 } else {
281 LOG_ERROR(Common_Filesystem, "Failed to get the path to the %APPDATA% directory"); 275 LOG_ERROR(Common_Filesystem, "Failed to get the path to the %APPDATA% directory");