aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llappviewer.cpp')
-rw-r--r--linden/indra/newview/llappviewer.cpp64
1 files changed, 58 insertions, 6 deletions
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index c9ab291..2fab25b 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -2963,10 +2963,11 @@ bool LLAppViewer::initCache()
2963{ 2963{
2964 mPurgeCache = false; 2964 mPurgeCache = false;
2965 // Purge cache if user requested it 2965 // Purge cache if user requested it
2966 if (gSavedSettings.getBOOL("PurgeCacheOnStartup") || 2966 if (gSavedSettings.getBOOL("PurgeCacheOnStartup") || // cmd-line -- MC
2967 gSavedSettings.getBOOL("PurgeCacheOnNextStartup")) 2967 gSavedSettings.getBOOL("PurgeCacheOnNextStartup")) // ui -- MC
2968 { 2968 {
2969 gSavedSettings.setBOOL("PurgeCacheOnNextStartup", false); 2969 gSavedSettings.setBOOL("PurgeCacheOnNextStartup", false);
2970 gSavedSettings.setBOOL("PurgeCacheOnStartup", FALSE);
2970 mPurgeCache = true; 2971 mPurgeCache = true;
2971 } 2972 }
2972 // Purge cache if it belongs to an old version 2973 // Purge cache if it belongs to an old version
@@ -3175,10 +3176,61 @@ bool LLAppViewer::initCache()
3175 3176
3176void LLAppViewer::purgeCache() 3177void LLAppViewer::purgeCache()
3177{ 3178{
3178 LL_INFOS("AppCache") << "Purging Cache and Texture Cache..." << llendl; 3179 LL_INFOS("AppCache") << "Begin purging cachees..." << llendl;
3179 LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE); 3180 if (gSavedSettings.getBOOL("PurgeCacheOnStartup")) // purging from cmd line
3180 std::string mask = gDirUtilp->getDirDelimiter() + "*.*"; 3181 {
3181 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""),mask); 3182 LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE);
3183 std::string mask = gDirUtilp->getDirDelimiter() + "*.*";
3184 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""), mask);
3185 }
3186 else // purging cache from ui
3187 {
3188 if (gSavedSettings.getBOOL("ClearTextureCache"))
3189 {
3190 LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE);
3191 gSavedSettings.setBOOL("ClearTextureCache", FALSE);
3192 }
3193
3194 if (gSavedSettings.getBOOL("ClearObjectCache"))
3195 {
3196 std::string mask = gDirUtilp->getDirDelimiter() + "*.slc";
3197 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""), mask);
3198 gSavedSettings.setBOOL("ClearObjectCache", FALSE);
3199 }
3200
3201 if (gSavedSettings.getBOOL("ClearInvCache"))
3202 {
3203 std::vector<std::string> masks;
3204 masks.push_back(gDirUtilp->getDirDelimiter() + "*.inv.gz");
3205 masks.push_back(gDirUtilp->getDirDelimiter() + VFS_DATA_FILE_BASE + "*");
3206 masks.push_back(gDirUtilp->getDirDelimiter() + VFS_INDEX_FILE_BASE + "*");
3207
3208 for (std::vector<std::string>::iterator vIt = masks.begin();
3209 vIt != masks.end(); ++vIt)
3210 {
3211 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""), (*vIt));
3212 }
3213
3214 gSavedSettings.setBOOL("ClearInvCache", FALSE);
3215 }
3216
3217 if (gSavedSettings.getBOOL("ClearNameCache"))
3218 {
3219 // ick @ not making these variables -- MC
3220 std::vector<std::string> masks;
3221 masks.push_back(gDirUtilp->getDirDelimiter() + "name.cache");
3222 masks.push_back(gDirUtilp->getDirDelimiter() + "avatar_name_cache.xml");
3223 masks.push_back(gDirUtilp->getDirDelimiter() + "*.cached_mute");
3224
3225 for (std::vector<std::string>::iterator vIt = masks.begin();
3226 vIt != masks.end(); ++vIt)
3227 {
3228 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""), (*vIt));
3229 }
3230
3231 gSavedSettings.setBOOL("ClearNameCache", FALSE);
3232 }
3233 }
3182} 3234}
3183 3235
3184const std::string& LLAppViewer::getSecondLifeTitle() const 3236const std::string& LLAppViewer::getSecondLifeTitle() const