diff options
Diffstat (limited to 'linden/indra/llvfs/lldir.cpp')
-rw-r--r-- | linden/indra/llvfs/lldir.cpp | 52 |
1 files changed, 36 insertions, 16 deletions
diff --git a/linden/indra/llvfs/lldir.cpp b/linden/indra/llvfs/lldir.cpp index eb705dd..29a3771 100644 --- a/linden/indra/llvfs/lldir.cpp +++ b/linden/indra/llvfs/lldir.cpp | |||
@@ -17,7 +17,8 @@ | |||
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | 20 | * online at |
21 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | 22 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 23 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 24 | * that you have read and understood your obligations described above, |
@@ -215,30 +216,44 @@ const std::string LLDir::getCacheDir(bool get_default) const | |||
215 | { | 216 | { |
216 | if (mCacheDir.empty() || get_default) | 217 | if (mCacheDir.empty() || get_default) |
217 | { | 218 | { |
218 | std::string res; | 219 | if (!mDefaultCacheDir.empty()) |
219 | if (getOSCacheDir().empty()) | 220 | { // Set at startup - can't set here due to const API |
221 | return mDefaultCacheDir; | ||
222 | } | ||
223 | |||
224 | std::string res = buildSLOSCacheDir(); | ||
225 | return res; | ||
226 | } | ||
227 | else | ||
228 | { | ||
229 | return mCacheDir; | ||
230 | } | ||
231 | } | ||
232 | |||
233 | // Return the default cache directory | ||
234 | std::string LLDir::buildSLOSCacheDir() const | ||
235 | { | ||
236 | std::string res; | ||
237 | if (getOSCacheDir().empty()) | ||
238 | { | ||
239 | if (getOSUserAppDir().empty()) | ||
220 | { | 240 | { |
221 | if (getOSUserAppDir().empty()) | 241 | res = "data"; |
222 | { | ||
223 | res = "data"; | ||
224 | } | ||
225 | else | ||
226 | { | ||
227 | res = getOSUserAppDir() + mDirDelimiter + "cache"; | ||
228 | } | ||
229 | } | 242 | } |
230 | else | 243 | else |
231 | { | 244 | { |
232 | res = getOSCacheDir() + mDirDelimiter + "Imprudence"; | 245 | res = getOSUserAppDir() + mDirDelimiter + "cache"; |
233 | } | 246 | } |
234 | return res; | ||
235 | } | 247 | } |
236 | else | 248 | else |
237 | { | 249 | { |
238 | return mCacheDir; | 250 | res = getOSCacheDir() + mDirDelimiter + "Imprudence"; |
239 | } | 251 | } |
252 | return res; | ||
240 | } | 253 | } |
241 | 254 | ||
255 | |||
256 | |||
242 | const std::string &LLDir::getOSCacheDir() const | 257 | const std::string &LLDir::getOSCacheDir() const |
243 | { | 258 | { |
244 | return mOSCacheDir; | 259 | return mOSCacheDir; |
@@ -378,7 +393,7 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd | |||
378 | case LL_PATH_EXECUTABLE: | 393 | case LL_PATH_EXECUTABLE: |
379 | prefix = getExecutableDir(); | 394 | prefix = getExecutableDir(); |
380 | break; | 395 | break; |
381 | 396 | ||
382 | default: | 397 | default: |
383 | llassert(0); | 398 | llassert(0); |
384 | } | 399 | } |
@@ -418,7 +433,7 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd | |||
418 | expanded_filename.assign(""); | 433 | expanded_filename.assign(""); |
419 | } | 434 | } |
420 | 435 | ||
421 | //llinfos << "*** EXPANDED FILENAME: <" << mExpandedFilename << ">" << llendl; | 436 | //llinfos << "*** EXPANDED FILENAME: <" << expanded_filename << ">" << llendl; |
422 | 437 | ||
423 | return expanded_filename; | 438 | return expanded_filename; |
424 | } | 439 | } |
@@ -654,6 +669,11 @@ void LLDir::dumpCurrentDirectories() | |||
654 | LL_DEBUGS2("AppInit","Directories") << " TempDir: " << getTempDir() << LL_ENDL; | 669 | LL_DEBUGS2("AppInit","Directories") << " TempDir: " << getTempDir() << LL_ENDL; |
655 | LL_DEBUGS2("AppInit","Directories") << " CAFile: " << getCAFile() << LL_ENDL; | 670 | LL_DEBUGS2("AppInit","Directories") << " CAFile: " << getCAFile() << LL_ENDL; |
656 | LL_DEBUGS2("AppInit","Directories") << " SkinDir: " << getSkinDir() << LL_ENDL; | 671 | LL_DEBUGS2("AppInit","Directories") << " SkinDir: " << getSkinDir() << LL_ENDL; |
672 | |||
673 | #if LL_LIBXUL_ENABLED | ||
674 | LL_DEBUGS2("AppInit","Directories") << " HTML Path: " << getExpandedFilename( LL_PATH_HTML, "" ) << llendl; | ||
675 | LL_DEBUGS2("AppInit","Directories") << " Mozilla Profile Path: " << getExpandedFilename( LL_PATH_MOZILLA_PROFILE, "" ) << llendl; | ||
676 | #endif | ||
657 | } | 677 | } |
658 | 678 | ||
659 | 679 | ||