Skip to content
Snippets Groups Projects
Commit b96d890c authored by Christian Goetze's avatar Christian Goetze
Browse files

QAR-1141 svn merge -r107086:107087 svn+ssh://svn.lindenlab.com/svn/user/cg/llvfs-fix-2

parent 36645d1c
No related branches found
No related tags found
No related merge requests found
...@@ -214,6 +214,23 @@ const std::string &LLDir::getTempDir() const ...@@ -214,6 +214,23 @@ const std::string &LLDir::getTempDir() const
const std::string LLDir::getCacheDir(bool get_default) const const std::string LLDir::getCacheDir(bool get_default) const
{ {
if (mCacheDir.empty() || get_default) if (mCacheDir.empty() || get_default)
{
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; std::string res;
if (getOSCacheDir().empty()) if (getOSCacheDir().empty())
...@@ -233,11 +250,8 @@ const std::string LLDir::getCacheDir(bool get_default) const ...@@ -233,11 +250,8 @@ const std::string LLDir::getCacheDir(bool get_default) const
} }
return res; return res;
} }
else
{
return mCacheDir;
}
}
const std::string &LLDir::getOSCacheDir() const const std::string &LLDir::getOSCacheDir() const
{ {
......
...@@ -126,6 +126,9 @@ class LLDir ...@@ -126,6 +126,9 @@ class LLDir
virtual void dumpCurrentDirectories(); virtual void dumpCurrentDirectories();
// Utility routine
std::string buildSLOSCacheDir() const;
protected: protected:
std::string mAppName; // install directory under progams/ ie "SecondLife" std::string mAppName; // install directory under progams/ ie "SecondLife"
std::string mExecutablePathAndName; // full path + Filename of .exe std::string mExecutablePathAndName; // full path + Filename of .exe
...@@ -141,6 +144,7 @@ class LLDir ...@@ -141,6 +144,7 @@ class LLDir
std::string mCAFile; // Location of the TLS certificate authority PEM file. std::string mCAFile; // Location of the TLS certificate authority PEM file.
std::string mTempDir; std::string mTempDir;
std::string mCacheDir; // cache directory as set by user preference std::string mCacheDir; // cache directory as set by user preference
std::string mDefaultCacheDir; // default cache diretory
std::string mOSCacheDir; // operating system cache dir std::string mOSCacheDir; // operating system cache dir
std::string mDirDelimiter; std::string mDirDelimiter;
std::string mSkinDir; // Location for current skin info. std::string mSkinDir; // Location for current skin info.
......
...@@ -128,6 +128,20 @@ LLDir_Win32::LLDir_Win32() ...@@ -128,6 +128,20 @@ LLDir_Win32::LLDir_Win32()
mAppRODataDir = getCurPath(); mAppRODataDir = getCurPath();
else else
mAppRODataDir = mExecutableDir; mAppRODataDir = mExecutableDir;
// Build the default cache directory
mDefaultCacheDir = buildSLOSCacheDir();
// Make sure it exists
int res = LLFile::mkdir(mDefaultCacheDir);
if (res == -1)
{
if (errno != EEXIST)
{
llwarns << "Couldn't create LL_PATH_CACHE dir " << mDefaultCacheDir << llendl;
}
}
} }
LLDir_Win32::~LLDir_Win32() LLDir_Win32::~LLDir_Win32()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment