summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorCreak <romain.failliot@foolstep.com>2021-10-12 03:56:25 +0200
committerGitHub <noreply@github.com>2021-10-12 03:56:25 +0200
commit0b8a7ca2138de7601de4e63816305688b94041c7 (patch)
treed2e716bc3da9cd619c577048b6ba4768b30e1e2e /src/common
parentMerge pull request #7161 from MightyCreak/fix-some-warnings (diff)
downloadyuzu-0b8a7ca2138de7601de4e63816305688b94041c7.tar
yuzu-0b8a7ca2138de7601de4e63816305688b94041c7.tar.gz
yuzu-0b8a7ca2138de7601de4e63816305688b94041c7.tar.bz2
yuzu-0b8a7ca2138de7601de4e63816305688b94041c7.tar.lz
yuzu-0b8a7ca2138de7601de4e63816305688b94041c7.tar.xz
yuzu-0b8a7ca2138de7601de4e63816305688b94041c7.tar.zst
yuzu-0b8a7ca2138de7601de4e63816305688b94041c7.zip
Diffstat (limited to 'src/common')
-rw-r--r--src/common/fs/path_util.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp
index 43b79bd6d..1bcb897b5 100644
--- a/src/common/fs/path_util.cpp
+++ b/src/common/fs/path_util.cpp
@@ -82,32 +82,35 @@ public:
private:
PathManagerImpl() {
+ fs::path yuzu_path;
+ fs::path yuzu_path_cache;
+ fs::path yuzu_path_config;
+
#ifdef _WIN32
- auto yuzu_path = GetExeDirectory() / PORTABLE_DIR;
+ yuzu_path = GetExeDirectory() / PORTABLE_DIR;
if (!IsDir(yuzu_path)) {
yuzu_path = GetAppDataRoamingDirectory() / YUZU_DIR;
}
- GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path);
- GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path / CACHE_DIR);
- GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path / CONFIG_DIR);
+ yuzu_path_cache = yuzu_path / CACHE_DIR;
+ yuzu_path_config = yuzu_path / CONFIG_DIR;
#else
- auto yuzu_path = GetCurrentDir() / PORTABLE_DIR;
+ yuzu_path = GetCurrentDir() / PORTABLE_DIR;
if (Exists(yuzu_path) && IsDir(yuzu_path)) {
- GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path);
- GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path / CACHE_DIR);
- GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path / CONFIG_DIR);
+ yuzu_path_cache = yuzu_path / CACHE_DIR;
+ yuzu_path_config = yuzu_path / CONFIG_DIR;
} else {
yuzu_path = GetDataDirectory("XDG_DATA_HOME") / YUZU_DIR;
-
- GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path);
- GenerateYuzuPath(YuzuPath::CacheDir, GetDataDirectory("XDG_CACHE_HOME") / YUZU_DIR);
- GenerateYuzuPath(YuzuPath::ConfigDir, GetDataDirectory("XDG_CONFIG_HOME") / YUZU_DIR);
+ yuzu_path_cache = GetDataDirectory("XDG_CACHE_HOME") / YUZU_DIR;
+ yuzu_path_config = GetDataDirectory("XDG_CONFIG_HOME") / YUZU_DIR;
}
#endif
+ GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path);
+ GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path_cache);
+ GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path_config);
GenerateYuzuPath(YuzuPath::DumpDir, yuzu_path / DUMP_DIR);
GenerateYuzuPath(YuzuPath::KeysDir, yuzu_path / KEYS_DIR);
GenerateYuzuPath(YuzuPath::LoadDir, yuzu_path / LOAD_DIR);