summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorCallum Prentice <callum@gmail.com>2020-10-07 15:25:12 -0700
committerCallum Prentice <callum@gmail.com>2020-10-07 15:25:12 -0700
commit08dfc0836fb12855d0c07d811e2909400d5b74f3 (patch)
tree383c203f7084086ae5e3804cd126dc32c4048516 /indra/newview/llappviewer.cpp
parenta0ea119623b8bda445f86afdb0ea7b5833c8e171 (diff)
This changeset hooks up many things that have been in progress and moves things about between llfilesystem and lldiskcache - there is still some bookkeeping work left but this is the first version that appears to work and actively manage the cache
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 0d25cb6dc8..1914ca89de 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -98,6 +98,7 @@
#include "lllogininstance.h"
#include "llprogressview.h"
#include "llvocache.h"
+#include "lldiskcache.h"
#include "llvopartgroup.h"
#include "llweb.h"
#include "llfloatertexturefetchdebugger.h"
@@ -115,7 +116,6 @@
#include "llprimitive.h"
#include "llurlaction.h"
#include "llurlentry.h"
-#include "llfilesystem.h"
#include "llvolumemgr.h"
#include "llxfermanager.h"
#include "llphysicsextensions.h"
@@ -1855,9 +1855,6 @@ bool LLAppViewer::cleanup()
SUBSYSTEM_CLEANUP(LLWorldMapView);
SUBSYSTEM_CLEANUP(LLFolderViewItem);
- LL_INFOS() << "Cleaning up disk cache" << LL_ENDL;
- SUBSYSTEM_CLEANUP(LLFileSystem);
-
LL_INFOS() << "Saving Data" << LL_ENDL;
// Store the time of our current logoff
@@ -4111,6 +4108,9 @@ bool LLAppViewer::initCache()
{
LLSplashScreen::update(LLTrans::getString("StartupClearingCache"));
purgeCache();
+
+ // purge the new C++ file system based cache
+ LLDiskCache::getInstance()->purge();
}
LLSplashScreen::update(LLTrans::getString("StartupInitializingTextureCache"));
@@ -4131,7 +4131,12 @@ bool LLAppViewer::initCache()
LLVOCache::getInstance()->initCache(LL_PATH_CACHE, gSavedSettings.getU32("CacheNumberOfRegionsForObjects"), getObjectCacheVersion());
- LLFileSystem::initClass();
+ // initialize the new disk cache using saved settings
+ const std::string cache_dir_name = gSavedSettings.getString("DiskCacheDirName");
+ const unsigned int cache_max_bytes = gSavedSettings.getU32("DiskCacheMaxSizeMB") * 1024 * 1024;
+ const bool enable_cache_debug_info = gSavedSettings.getBOOL("EnableDiskCacheDebugInfo");
+ const std::string cache_dir = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, cache_dir_name);
+ LLDiskCache::initParamSingleton(cache_dir, cache_max_bytes, enable_cache_debug_info);
return true;
}