diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-08-12 17:29:50 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-08-12 17:29:50 +0000 |
commit | 80be4c1d2d73982ea2df6dd7ef3fc3465416c882 (patch) | |
tree | 9c5958572368be494b6302db8b03967a2c67b7ad /indra/llvfs | |
parent | a09f7d41efdb945755efaeb07f7418c1f6e2a78b (diff) |
QAR-767 Combined maint-render-7 and maint-viewer-9 merge
merge release@93398 viewer-merge-1@94007 -> release
dataserver-is-deprecated
Diffstat (limited to 'indra/llvfs')
-rw-r--r-- | indra/llvfs/lldir.cpp | 37 | ||||
-rw-r--r-- | indra/llvfs/lldir.h | 5 | ||||
-rw-r--r-- | indra/llvfs/lldir_mac.cpp | 11 |
3 files changed, 46 insertions, 7 deletions
diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index f4865202d5..325a2a39b6 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -59,8 +59,19 @@ LLDir_Linux gDirUtil; LLDir *gDirUtilp = (LLDir *)&gDirUtil; -LLDir::LLDir() -: mDirDelimiter("/") // fallback to forward slash if not overridden +LLDir::LLDir() +: mAppName(""), + mExecutablePathAndName(""), + mExecutableFilename(""), + mExecutableDir(""), + mAppRODataDir(""), + mOSUserDir(""), + mOSUserAppDir(""), + mLindenUserDir(""), + mOSCacheDir(""), + mCAFile(""), + mTempDir(""), + mDirDelimiter("/") // fallback to forward slash if not overridden { } @@ -205,13 +216,20 @@ const std::string LLDir::getCacheDir(bool get_default) const if (mCacheDir.empty() || get_default) { std::string res; - if (getOSUserAppDir().empty()) + if (getOSCacheDir().empty()) { - res = "data"; + if (getOSUserAppDir().empty()) + { + res = "data"; + } + else + { + res = getOSUserAppDir() + mDirDelimiter + "cache"; + } } else { - res = getOSUserAppDir() + mDirDelimiter + "cache"; + res = getOSCacheDir() + mDirDelimiter + "SecondLife"; } return res; } @@ -221,6 +239,12 @@ const std::string LLDir::getCacheDir(bool get_default) const } } +const std::string &LLDir::getOSCacheDir() const +{ + return mOSCacheDir; +} + + const std::string &LLDir::getCAFile() const { return mCAFile; @@ -350,6 +374,9 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd prefix += mDirDelimiter; prefix += "browser_profile"; break; + + case LL_PATH_EXECUTABLE: + prefix = getExecutableDir(); default: llassert(0); diff --git a/indra/llvfs/lldir.h b/indra/llvfs/lldir.h index 93b15276a3..b0255b4d00 100644 --- a/indra/llvfs/lldir.h +++ b/indra/llvfs/lldir.h @@ -51,7 +51,8 @@ typedef enum ELLPath LL_PATH_PER_ACCOUNT_CHAT_LOGS = 13, LL_PATH_MOZILLA_PROFILE = 14, // LL_PATH_HTML = 15, - LL_PATH_LAST = 16 + LL_PATH_EXECUTABLE = 16, + LL_PATH_LAST } ELLPath; @@ -86,6 +87,7 @@ class LLDir const std::string &getPerAccountChatLogsDir() const; // Location of the per account chat logs dir. const std::string &getTempDir() const; // Common temporary directory const std::string getCacheDir(bool get_default = false) const; // Location of the cache. + const std::string &getOSCacheDir() const; // location of OS-specific cache folder (may be empty string) const std::string &getCAFile() const; // File containing TLS certificate authorities const std::string &getDirDelimiter() const; // directory separator for platform (ie. '\' or '/' or ':') const std::string &getSkinDir() const; // User-specified skin folder. @@ -135,6 +137,7 @@ protected: std::string mCAFile; // Location of the TLS certificate authority PEM file. std::string mTempDir; std::string mCacheDir; + std::string mOSCacheDir; std::string mDirDelimiter; std::string mSkinDir; // Location for current skin info. std::string mDefaultSkinDir; // Location for default skin info. diff --git a/indra/llvfs/lldir_mac.cpp b/indra/llvfs/lldir_mac.cpp index 80134e2978..a6072c02fe 100644 --- a/indra/llvfs/lldir_mac.cpp +++ b/indra/llvfs/lldir_mac.cpp @@ -159,13 +159,22 @@ LLDir_Mac::LLDir_Mac() // Create our sub-dirs (void) CFCreateDirectory(&newFileRef, CFSTR("data"), NULL); - (void) CFCreateDirectory(&newFileRef, CFSTR("cache"), NULL); + //(void) CFCreateDirectory(&newFileRef, CFSTR("cache"), NULL); (void) CFCreateDirectory(&newFileRef, CFSTR("logs"), NULL); (void) CFCreateDirectory(&newFileRef, CFSTR("user_settings"), NULL); (void) CFCreateDirectory(&newFileRef, CFSTR("browser_profile"), NULL); } } + //mOSCacheDir + FSRef cacheDirRef; + error = FSFindFolder(kUserDomain, kCachedDataFolderType, true, &cacheDirRef); + if (error == noErr) + { + FSRefToLLString(&cacheDirRef, mOSCacheDir); + (void)CFCreateDirectory(&cacheDirRef, CFSTR("SecondLife"),NULL); + } + // mOSUserAppDir mOSUserAppDir = mOSUserDir; |