aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMcCabe Maxsted2011-07-05 20:33:04 -0700
committerMcCabe Maxsted2011-07-05 20:42:08 -0700
commit0512d1cb6befcd5e291b4c9c9db4df9f9de04db1 (patch)
tree4adfcb2fed990b1e383a06898c21063fc01619e2
parentAdded clear sounds cache option (diff)
downloadmeta-impy-0512d1cb6befcd5e291b4c9c9db4df9f9de04db1.zip
meta-impy-0512d1cb6befcd5e291b4c9c9db4df9f9de04db1.tar.gz
meta-impy-0512d1cb6befcd5e291b4c9c9db4df9f9de04db1.tar.bz2
meta-impy-0512d1cb6befcd5e291b4c9c9db4df9f9de04db1.tar.xz
A little cleanup for cache clearing
-rw-r--r--linden/indra/newview/llappviewer.cpp37
1 files changed, 11 insertions, 26 deletions
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp
index 5a398a5..b96f6c2 100644
--- a/linden/indra/newview/llappviewer.cpp
+++ b/linden/indra/newview/llappviewer.cpp
@@ -3188,8 +3188,7 @@ void LLAppViewer::purgeCache()
3188 if (gSavedSettings.getBOOL("PurgeCacheOnStartup")) // purging from cmd line 3188 if (gSavedSettings.getBOOL("PurgeCacheOnStartup")) // purging from cmd line
3189 { 3189 {
3190 LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE); 3190 LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE);
3191 std::string mask = gDirUtilp->getDirDelimiter() + "*.*"; 3191 removeCacheFiles("*.*");
3192 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""), mask);
3193 } 3192 }
3194 else // purging cache from ui 3193 else // purging cache from ui
3195 { 3194 {
@@ -3201,41 +3200,27 @@ void LLAppViewer::purgeCache()
3201 3200
3202 if (gSavedSettings.getBOOL("ClearObjectCache")) 3201 if (gSavedSettings.getBOOL("ClearObjectCache"))
3203 { 3202 {
3204 std::string mask = gDirUtilp->getDirDelimiter() + "*.slc"; 3203 removeCacheFiles("*.slc");
3205 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""), mask);
3206 gSavedSettings.setBOOL("ClearObjectCache", FALSE); 3204 gSavedSettings.setBOOL("ClearObjectCache", FALSE);
3207 } 3205 }
3208 3206
3209 if (gSavedSettings.getBOOL("ClearInvCache")) 3207 if (gSavedSettings.getBOOL("ClearInvCache"))
3210 { 3208 {
3211 std::vector<std::string> masks; 3209 removeCacheFiles("*.inv.gz");
3212 masks.push_back(gDirUtilp->getDirDelimiter() + "*.inv.gz"); 3210 removeCacheFiles(std::string(VFS_DATA_FILE_BASE) + "*");
3213 masks.push_back(gDirUtilp->getDirDelimiter() + VFS_DATA_FILE_BASE + "*"); 3211 removeCacheFiles(std::string(VFS_INDEX_FILE_BASE) + "*");
3214 masks.push_back(gDirUtilp->getDirDelimiter() + VFS_INDEX_FILE_BASE + "*"); 3212 removeCacheFiles("*.lso");
3215 3213 removeCacheFiles("*.bodypart");
3216 for (std::vector<std::string>::iterator vIt = masks.begin(); 3214 removeCacheFiles("*.clothing");
3217 vIt != masks.end(); ++vIt)
3218 {
3219 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""), (*vIt));
3220 }
3221
3222 gSavedSettings.setBOOL("ClearInvCache", FALSE); 3215 gSavedSettings.setBOOL("ClearInvCache", FALSE);
3223 } 3216 }
3224 3217
3225 if (gSavedSettings.getBOOL("ClearNameCache")) 3218 if (gSavedSettings.getBOOL("ClearNameCache"))
3226 { 3219 {
3227 // ick @ not making these variables -- MC 3220 // ick @ not making these variables -- MC
3228 std::vector<std::string> masks; 3221 removeCacheFiles("name.cache");
3229 masks.push_back(gDirUtilp->getDirDelimiter() + "name.cache"); 3222 removeCacheFiles("avatar_name_cache.xml");
3230 masks.push_back(gDirUtilp->getDirDelimiter() + "avatar_name_cache.xml"); 3223 removeCacheFiles("*.cached_mute");
3231 masks.push_back(gDirUtilp->getDirDelimiter() + "*.cached_mute");
3232
3233 for (std::vector<std::string>::iterator vIt = masks.begin();
3234 vIt != masks.end(); ++vIt)
3235 {
3236 gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""), (*vIt));
3237 }
3238
3239 gSavedSettings.setBOOL("ClearNameCache", FALSE); 3224 gSavedSettings.setBOOL("ClearNameCache", FALSE);
3240 } 3225 }
3241 3226