diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-10-07 20:06:15 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-10-07 20:06:15 +0400 |
commit | 098207e634699546c0b2409fbce68e345ba80f00 (patch) | |
tree | 5cae08bfa1fe6bcaa735ca9674a4604d6a57a2f9 | |
parent | 23440884fea7e70a320d9fffd971fb7005b31589 (diff) |
Fix regression in r59316
Different version could be passed here, added check
cached path is calculated with the proper one.
-rw-r--r-- | intern/ghost/intern/GHOST_SystemPathsX11.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/intern/ghost/intern/GHOST_SystemPathsX11.cpp b/intern/ghost/intern/GHOST_SystemPathsX11.cpp index 50eb68d9264..e2d9733a9b2 100644 --- a/intern/ghost/intern/GHOST_SystemPathsX11.cpp +++ b/intern/ghost/intern/GHOST_SystemPathsX11.cpp @@ -74,13 +74,16 @@ const GHOST_TUns8 *GHOST_SystemPathsX11::getSystemDir(int, const char *versionst const GHOST_TUns8 *GHOST_SystemPathsX11::getUserDir(int version, const char *versionstr) const { static string user_path = ""; + static int last_version = 0; /* in blender 2.64, we migrate to XDG. to ensure the copy previous settings * operator works we give a different path depending on the requested version */ if (version < 264) { - if (user_path.empty()) { + if (user_path.empty() || last_version != version) { const char *home = getenv("HOME"); + last_version = version; + if (home) { user_path = string(home) + "/.blender/" + versionstr; } @@ -91,9 +94,11 @@ const GHOST_TUns8 *GHOST_SystemPathsX11::getUserDir(int version, const char *ver return (GHOST_TUns8 *)user_path.c_str(); } else { - if (user_path.empty()) { + if (user_path.empty() || last_version != version) { const char *home = getenv("XDG_CONFIG_HOME"); + last_version = version; + if (home) { user_path = string(home) + "/blender/" + versionstr; } |