diff options
author | Jacek Antonelli | 2009-04-30 13:04:20 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-04-30 13:07:16 -0500 |
commit | ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch) | |
tree | 8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/llvfs/lldir.cpp | |
parent | Second Life viewer sources 1.22.11 (diff) | |
download | meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2 meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz |
Second Life viewer sources 1.23.0-RC
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 4c4dba1..d6a6eca 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 + "SecondLife"; | 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 + "SecondLife"; |
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 | } |
@@ -646,6 +661,11 @@ void LLDir::dumpCurrentDirectories() | |||
646 | LL_DEBUGS2("AppInit","Directories") << " TempDir: " << getTempDir() << LL_ENDL; | 661 | LL_DEBUGS2("AppInit","Directories") << " TempDir: " << getTempDir() << LL_ENDL; |
647 | LL_DEBUGS2("AppInit","Directories") << " CAFile: " << getCAFile() << LL_ENDL; | 662 | LL_DEBUGS2("AppInit","Directories") << " CAFile: " << getCAFile() << LL_ENDL; |
648 | LL_DEBUGS2("AppInit","Directories") << " SkinDir: " << getSkinDir() << LL_ENDL; | 663 | LL_DEBUGS2("AppInit","Directories") << " SkinDir: " << getSkinDir() << LL_ENDL; |
664 | |||
665 | #if LL_LIBXUL_ENABLED | ||
666 | LL_DEBUGS2("AppInit","Directories") << " HTML Path: " << getExpandedFilename( LL_PATH_HTML, "" ) << llendl; | ||
667 | LL_DEBUGS2("AppInit","Directories") << " Mozilla Profile Path: " << getExpandedFilename( LL_PATH_MOZILLA_PROFILE, "" ) << llendl; | ||
668 | #endif | ||
649 | } | 669 | } |
650 | 670 | ||
651 | 671 | ||