QAR-1141 svn merge -r107086:107087 svn+ssh://svn.lindenlab.com/svn/user/cg/llvfs-fix-2
parent
36645d1c52
commit
b96d890c44
|
|
@ -215,22 +215,12 @@ const std::string LLDir::getCacheDir(bool get_default) const
|
|||
{
|
||||
if (mCacheDir.empty() || get_default)
|
||||
{
|
||||
std::string res;
|
||||
if (getOSCacheDir().empty())
|
||||
{
|
||||
if (getOSUserAppDir().empty())
|
||||
{
|
||||
res = "data";
|
||||
}
|
||||
else
|
||||
{
|
||||
res = getOSUserAppDir() + mDirDelimiter + "cache";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
res = getOSCacheDir() + mDirDelimiter + "SecondLife";
|
||||
if (!mDefaultCacheDir.empty())
|
||||
{ // Set at startup - can't set here due to const API
|
||||
return mDefaultCacheDir;
|
||||
}
|
||||
|
||||
std::string res = buildSLOSCacheDir();
|
||||
return res;
|
||||
}
|
||||
else
|
||||
|
|
@ -239,6 +229,30 @@ const std::string LLDir::getCacheDir(bool get_default) const
|
|||
}
|
||||
}
|
||||
|
||||
// Return the default cache directory
|
||||
std::string LLDir::buildSLOSCacheDir() const
|
||||
{
|
||||
std::string res;
|
||||
if (getOSCacheDir().empty())
|
||||
{
|
||||
if (getOSUserAppDir().empty())
|
||||
{
|
||||
res = "data";
|
||||
}
|
||||
else
|
||||
{
|
||||
res = getOSUserAppDir() + mDirDelimiter + "cache";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
res = getOSCacheDir() + mDirDelimiter + "SecondLife";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const std::string &LLDir::getOSCacheDir() const
|
||||
{
|
||||
return mOSCacheDir;
|
||||
|
|
|
|||
|
|
@ -126,6 +126,9 @@ class LLDir
|
|||
|
||||
virtual void dumpCurrentDirectories();
|
||||
|
||||
// Utility routine
|
||||
std::string buildSLOSCacheDir() const;
|
||||
|
||||
protected:
|
||||
std::string mAppName; // install directory under progams/ ie "SecondLife"
|
||||
std::string mExecutablePathAndName; // full path + Filename of .exe
|
||||
|
|
@ -141,6 +144,7 @@ protected:
|
|||
std::string mCAFile; // Location of the TLS certificate authority PEM file.
|
||||
std::string mTempDir;
|
||||
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 mDirDelimiter;
|
||||
std::string mSkinDir; // Location for current skin info.
|
||||
|
|
|
|||
|
|
@ -128,6 +128,20 @@ LLDir_Win32::LLDir_Win32()
|
|||
mAppRODataDir = getCurPath();
|
||||
else
|
||||
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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue