summaryrefslogtreecommitdiff
path: root/indra/llvfs/lldir.cpp
diff options
context:
space:
mode:
authorChristian Goetze <cg@lindenlab.com>2009-01-06 23:30:52 +0000
committerChristian Goetze <cg@lindenlab.com>2009-01-06 23:30:52 +0000
commitb96d890c44c347bdc0d0109f0a2e3998233a4c5c (patch)
tree886810433c0d0fdc372b6553fd35616acd0255de /indra/llvfs/lldir.cpp
parent36645d1c52b2667d28c76f1aa8e2a0e60ad762bc (diff)
QAR-1141 svn merge -r107086:107087 svn+ssh://svn.lindenlab.com/svn/user/cg/llvfs-fix-2
Diffstat (limited to 'indra/llvfs/lldir.cpp')
-rw-r--r--indra/llvfs/lldir.cpp40
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;