diff options
| author | Markus Wick <degasus@users.noreply.github.com> | 2015-11-12 12:31:24 +0100 |
|---|---|---|
| committer | Markus Wick <degasus@users.noreply.github.com> | 2015-11-12 12:31:24 +0100 |
| commit | a498c684a26175508b4dd4c92edff4fb0cbfbf0e (patch) | |
| tree | 2d6787932319a6f91b5bb065fca6336063368529 /Source/Core/Common | |
| parent | 8924980b49968604d46655321c49fdd7da20384e (diff) | |
| parent | b61da5db5494dc8f2fb3bb3cd1ade05f1d80862b (diff) | |
Merge pull request #2304 from linkmauve/xdg-basedir
UICommon: Respect XDG Base Directory Specification on POSIX systems
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/CommonPaths.h | 11 | ||||
| -rw-r--r-- | Source/Core/Common/FileUtil.cpp | 10 |
2 files changed, 14 insertions, 7 deletions
diff --git a/Source/Core/Common/CommonPaths.h b/Source/Core/Common/CommonPaths.h index 5d81bd29e7..81bddc328f 100644 --- a/Source/Core/Common/CommonPaths.h +++ b/Source/Core/Common/CommonPaths.h @@ -24,11 +24,7 @@ #define DOLPHIN_DATA_DIR "/sdcard/dolphin-emu" #else #define USERDATA_DIR "user" - #ifdef USER_DIR - #define DOLPHIN_DATA_DIR USER_DIR - #else - #define DOLPHIN_DATA_DIR ".dolphin" - #endif + #define DOLPHIN_DATA_DIR "dolphin-emu" #endif // Shared data dirs (Sys and shared User for Linux) @@ -58,7 +54,7 @@ #define GAMESETTINGS_DIR "GameSettings" #define MAPS_DIR "Maps" #define CACHE_DIR "Cache" -#define SHADERCACHE_DIR "ShaderCache" +#define SHADERCACHE_DIR "Shaders" #define STATESAVES_DIR "StateSaves" #define SCREENSHOTS_DIR "ScreenShots" #define LOAD_DIR "Load" @@ -77,6 +73,9 @@ #define ANAGLYPH_DIR "Anaglyph" #define PIPES_DIR "Pipes" +// This one is only used to remove it if it was present +#define SHADERCACHE_LEGACY_DIR "ShaderCache" + // Filenames // Files in the directory returned by GetUserPath(D_CONFIG_IDX) #define DOLPHIN_CONFIG "Dolphin.ini" diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index 585b0c5cc1..f3af55548c 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -786,7 +786,7 @@ static void RebuildUserDirectories(unsigned int dir_index) s_user_paths[D_GAMESETTINGS_IDX] = s_user_paths[D_USER_IDX] + GAMESETTINGS_DIR DIR_SEP; s_user_paths[D_MAPS_IDX] = s_user_paths[D_USER_IDX] + MAPS_DIR DIR_SEP; s_user_paths[D_CACHE_IDX] = s_user_paths[D_USER_IDX] + CACHE_DIR DIR_SEP; - s_user_paths[D_SHADERCACHE_IDX] = s_user_paths[D_USER_IDX] + SHADERCACHE_DIR DIR_SEP; + s_user_paths[D_SHADERCACHE_IDX] = s_user_paths[D_CACHE_IDX] + SHADERCACHE_DIR DIR_SEP; s_user_paths[D_SHADERS_IDX] = s_user_paths[D_USER_IDX] + SHADERS_DIR DIR_SEP; s_user_paths[D_STATESAVES_IDX] = s_user_paths[D_USER_IDX] + STATESAVES_DIR DIR_SEP; s_user_paths[D_SCREENSHOTS_IDX] = s_user_paths[D_USER_IDX] + SCREENSHOTS_DIR DIR_SEP; @@ -809,6 +809,10 @@ static void RebuildUserDirectories(unsigned int dir_index) s_user_paths[F_ARAMDUMP_IDX] = s_user_paths[D_DUMP_IDX] + ARAM_DUMP; s_user_paths[F_FAKEVMEMDUMP_IDX] = s_user_paths[D_DUMP_IDX] + FAKEVMEM_DUMP; s_user_paths[F_GCSRAM_IDX] = s_user_paths[D_GCUSER_IDX] + GC_SRAM; + + // The shader cache has moved to the cache directory, so remove the old one. + // TODO: remove that someday. + File::DeleteDirRecursively(s_user_paths[D_USER_IDX] + SHADERCACHE_LEGACY_DIR DIR_SEP); break; case D_CONFIG_IDX: @@ -817,6 +821,10 @@ static void RebuildUserDirectories(unsigned int dir_index) s_user_paths[F_LOGGERCONFIG_IDX] = s_user_paths[D_CONFIG_IDX] + LOGGER_CONFIG; break; + case D_CACHE_IDX: + s_user_paths[D_SHADERCACHE_IDX] = s_user_paths[D_CACHE_IDX] + SHADERCACHE_DIR DIR_SEP; + break; + case D_GCUSER_IDX: s_user_paths[F_GCSRAM_IDX] = s_user_paths[D_GCUSER_IDX] + GC_SRAM; break; |
