diff options
Diffstat (limited to 'indra/newview/lllocationhistory.cpp')
-rw-r--r-- | indra/newview/lllocationhistory.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/indra/newview/lllocationhistory.cpp b/indra/newview/lllocationhistory.cpp index ab3256a186..179eca2532 100644 --- a/indra/newview/lllocationhistory.cpp +++ b/indra/newview/lllocationhistory.cpp @@ -36,6 +36,8 @@ #include <iomanip> // for std::setw() +#include "llui.h" + LLLocationHistory::LLLocationHistory() : mFilename("typed_locations.txt"), mLoadedCallback(NULL) @@ -44,11 +46,13 @@ LLLocationHistory::LLLocationHistory() : void LLLocationHistory::addItem(std::string item) { + static LLUICachedControl<S32> max_items("LocationHistoryMaxSize", 100); + mItems.push_back(item); // If the vector size exceeds the maximum, purge the oldest items. - if (mItems.size() > MAX_ITEMS) - mItems.erase(mItems.begin(), mItems.end()-MAX_ITEMS); + if ((S32)mItems.size() > max_items) + mItems.erase(mItems.begin(), mItems.end()-max_items); } |