diff options
author | Tom Grimshaw | 2010-05-25 12:21:17 +0100 |
---|---|---|
committer | Jacek Antonelli | 2010-06-19 02:43:25 -0500 |
commit | 7507619e14c79faf38e7946c81ceb2c532969832 (patch) | |
tree | 3bfd5c089198f3da3adf0bd9629f40ed0c3d4dd1 /linden/indra | |
parent | Fixed group creation alert showing the price as GROUPCREATEFEE (diff) | |
download | meta-impy-7507619e14c79faf38e7946c81ceb2c532969832.zip meta-impy-7507619e14c79faf38e7946c81ceb2c532969832.tar.gz meta-impy-7507619e14c79faf38e7946c81ceb2c532969832.tar.bz2 meta-impy-7507619e14c79faf38e7946c81ceb2c532969832.tar.xz |
Add a --cache command line flag to set cache location
Diffstat (limited to 'linden/indra')
-rw-r--r-- | linden/indra/newview/app_settings/cmd_line.xml | 10 | ||||
-rw-r--r-- | linden/indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | linden/indra/newview/llappviewer.cpp | 11 |
3 files changed, 29 insertions, 3 deletions
diff --git a/linden/indra/newview/app_settings/cmd_line.xml b/linden/indra/newview/app_settings/cmd_line.xml index d2d8b74..f5c6cdb 100644 --- a/linden/indra/newview/app_settings/cmd_line.xml +++ b/linden/indra/newview/app_settings/cmd_line.xml | |||
@@ -52,6 +52,16 @@ | |||
52 | <string>CmdLineGridChoice</string> | 52 | <string>CmdLineGridChoice</string> |
53 | </map> | 53 | </map> |
54 | 54 | ||
55 | <key>cache</key> | ||
56 | <map> | ||
57 | <key>desc</key> | ||
58 | <string>Specify the location of the local cache directory.</string> | ||
59 | <key>count</key> | ||
60 | <integer>1</integer> | ||
61 | <key>map-to</key> | ||
62 | <string>CmdLineCacheLocation</string> | ||
63 | </map> | ||
64 | |||
55 | <key>loginuri</key> | 65 | <key>loginuri</key> |
56 | <map> | 66 | <map> |
57 | <key>desc</key> | 67 | <key>desc</key> |
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 2885239..89cf2ab 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -48,6 +48,17 @@ | |||
48 | <key>Value</key> | 48 | <key>Value</key> |
49 | <string></string> | 49 | <string></string> |
50 | </map> | 50 | </map> |
51 | <key>CmdLineCacheLocation</key> | ||
52 | <map> | ||
53 | <key>Comment</key> | ||
54 | <string>Command line specified cache location to use.</string> | ||
55 | <key>Persist</key> | ||
56 | <integer>0</integer> | ||
57 | <key>Type</key> | ||
58 | <string>String</string> | ||
59 | <key>Value</key> | ||
60 | <string></string> | ||
61 | </map> | ||
51 | <key>DecimalsForTools</key> | 62 | <key>DecimalsForTools</key> |
52 | <map> | 63 | <map> |
53 | <key>Comment</key> | 64 | <key>Comment</key> |
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index 79a78b9..821742c 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp | |||
@@ -2915,16 +2915,21 @@ bool LLAppViewer::initCache() | |||
2915 | migrateCacheDirectory(); | 2915 | migrateCacheDirectory(); |
2916 | 2916 | ||
2917 | // Setup and verify the cache location | 2917 | // Setup and verify the cache location |
2918 | std::string cache_location = gSavedSettings.getString("CacheLocation"); | 2918 | std::string cache_location = gSavedSettings.getString("CmdLineCacheLocation"); |
2919 | if (cache_location.empty()) | ||
2920 | { | ||
2921 | cache_location = gSavedSettings.getString("CacheLocation"); | ||
2922 | } | ||
2919 | std::string new_cache_location = gSavedSettings.getString("NewCacheLocation"); | 2923 | std::string new_cache_location = gSavedSettings.getString("NewCacheLocation"); |
2920 | if (new_cache_location != cache_location) | 2924 | if ((new_cache_location != cache_location) && new_cache_location != "") |
2921 | { | 2925 | { |
2922 | gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation")); | 2926 | gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation")); |
2923 | purgeCache(); // purge old cache | 2927 | purgeCache(); // purge old cache |
2924 | gSavedSettings.setString("CacheLocation", new_cache_location); | 2928 | gSavedSettings.setString("CacheLocation", new_cache_location); |
2929 | cache_location = new_cache_location; | ||
2925 | } | 2930 | } |
2926 | 2931 | ||
2927 | if (!gDirUtilp->setCacheDir(gSavedSettings.getString("CacheLocation"))) | 2932 | if (!gDirUtilp->setCacheDir(cache_location)) |
2928 | { | 2933 | { |
2929 | LL_WARNS("AppCache") << "Unable to set cache location" << LL_ENDL; | 2934 | LL_WARNS("AppCache") << "Unable to set cache location" << LL_ENDL; |
2930 | gSavedSettings.setString("CacheLocation", ""); | 2935 | gSavedSettings.setString("CacheLocation", ""); |