From b96d890c44c347bdc0d0109f0a2e3998233a4c5c Mon Sep 17 00:00:00 2001 From: Christian Goetze Date: Tue, 6 Jan 2009 23:30:52 +0000 Subject: QAR-1141 svn merge -r107086:107087 svn+ssh://svn.lindenlab.com/svn/user/cg/llvfs-fix-2 --- indra/llvfs/lldir.cpp | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) (limited to 'indra/llvfs/lldir.cpp') 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; -- cgit v1.3