diff options
author | Bryan O'Sullivan <bos@lindenlab.com> | 2009-06-22 15:02:19 -0700 |
---|---|---|
committer | Bryan O'Sullivan <bos@lindenlab.com> | 2009-06-22 15:02:19 -0700 |
commit | baa73fddd9287ddafd2d31551cb253b355ed910a (patch) | |
tree | e3f0986617fe6c0ee0a14df6aac13c6bb6f92507 /indra/newview/lllocationhistory.cpp | |
parent | dc3833f31b8a20220ddb1775e1625c016c397435 (diff) | |
parent | fcaa1ad46fd1df4cfec9dee12caf6e7b5bf32136 (diff) |
Merge with viewer-2.0.0-3 branch
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); } |