diff options
Diffstat (limited to 'indra/llvfs/lldir.cpp')
-rw-r--r-- | indra/llvfs/lldir.cpp | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index c2562bcfc9..ef65ab0698 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -215,30 +215,44 @@ const std::string LLDir::getCacheDir(bool get_default) const { if (mCacheDir.empty() || get_default) { - std::string res; - if (getOSCacheDir().empty()) + if (!mDefaultCacheDir.empty()) + { // Set at startup - can't set here due to const API + return mDefaultCacheDir; + } + + std::string res = buildSLOSCacheDir(); + return res; + } + else + { + return mCacheDir; + } +} + +// Return the default cache directory +std::string LLDir::buildSLOSCacheDir() const +{ + std::string res; + if (getOSCacheDir().empty()) + { + if (getOSUserAppDir().empty()) { - if (getOSUserAppDir().empty()) - { - res = "data"; - } - else - { - res = getOSUserAppDir() + mDirDelimiter + "cache"; - } + res = "data"; } else { - res = getOSCacheDir() + mDirDelimiter + "SecondLife"; + res = getOSUserAppDir() + mDirDelimiter + "cache"; } - return res; } else { - return mCacheDir; + res = getOSCacheDir() + mDirDelimiter + "SecondLife"; } + return res; } + + const std::string &LLDir::getOSCacheDir() const { return mOSCacheDir; |