summaryrefslogtreecommitdiff
path: root/indra/newview/lllocationhistory.cpp
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@lindenlab.com>2009-06-22 15:02:19 -0700
committerBryan O'Sullivan <bos@lindenlab.com>2009-06-22 15:02:19 -0700
commitbaa73fddd9287ddafd2d31551cb253b355ed910a (patch)
treee3f0986617fe6c0ee0a14df6aac13c6bb6f92507 /indra/newview/lllocationhistory.cpp
parentdc3833f31b8a20220ddb1775e1625c016c397435 (diff)
parentfcaa1ad46fd1df4cfec9dee12caf6e7b5bf32136 (diff)
Merge with viewer-2.0.0-3 branch
Diffstat (limited to 'indra/newview/lllocationhistory.cpp')
-rw-r--r--indra/newview/lllocationhistory.cpp8
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);
}