summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelteleporthistory.cpp
diff options
context:
space:
mode:
authorMark Palange (Mani) <palange@lindenlab.com>2009-11-09 13:16:18 -0800
committerMark Palange (Mani) <palange@lindenlab.com>2009-11-09 13:16:18 -0800
commitb34b82f7fea702b7cb4309195314c45fd3d2e630 (patch)
tree8af0d2b7f2670902d9b3d7cf878081ffd7aacab7 /indra/newview/llpanelteleporthistory.cpp
parent06ba4927aa8d288b843ed1380132c14938708707 (diff)
parentdc5db676efd340bccd2c6f376c0bcba77e0507c4 (diff)
Automated merge with ssh://hg.lindenlab.com/brad/brad-parabuild
Diffstat (limited to 'indra/newview/llpanelteleporthistory.cpp')
-rw-r--r--indra/newview/llpanelteleporthistory.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index 28e89fd619..72856d5b82 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -406,6 +406,7 @@ void LLTeleportHistoryPanel::getNextTab(const LLDate& item_date, S32& tab_idx, L
if (tab_idx <= tabs_cnt - 4)
{
+ // All tabs, except last three, are tabs for one day, so just push tab_date back by one day
tab_date.secondsSinceEpoch(tab_date.secondsSinceEpoch() - seconds_in_day);
}
else if (tab_idx == tabs_cnt - 3) // 6 day and older, low boundary is 1 month
@@ -442,6 +443,7 @@ void LLTeleportHistoryPanel::getNextTab(const LLDate& item_date, S32& tab_idx, L
}
}
+// Called to add items, no more, than ADD_LIMIT at time
void LLTeleportHistoryPanel::refresh()
{
if (!mHistoryAccordion)
@@ -452,12 +454,16 @@ void LLTeleportHistoryPanel::refresh()
const LLTeleportHistoryStorage::slurl_list_t& items = mTeleportHistory->getItems();
+ // Setting tab_boundary_date to "now", so date from any item would be earlier, than boundary.
+ // That leads to call to getNextTab to get right tab_idx in first pass
LLDate tab_boundary_date = LLDate::now();
+
LLFlatListView* curr_flat_view = NULL;
U32 added_items = 0;
while (mCurrentItem >= 0)
{
+ // Filtering
std::string landmark_title = items[mCurrentItem].mTitle;
LLStringUtil::toUpper(landmark_title);
@@ -470,10 +476,14 @@ void LLTeleportHistoryPanel::refresh()
continue;
}
+ // Checking whether date of item is earlier, than tab_boundary_date.
+ // In that case, item should be added to another tab
const LLDate &date = items[mCurrentItem].mDate;
if (date < tab_boundary_date)
{
+ // Getting apropriate tab_idx for this and subsequent items,
+ // tab_boundary_date would be earliest possible date for this tab
S32 tab_idx = 0;
getNextTab(date, tab_idx, tab_boundary_date);
@@ -580,6 +590,9 @@ void LLTeleportHistoryPanel::replaceItem(S32 removed_index)
void LLTeleportHistoryPanel::showTeleportHistory()
{
mDirty = true;
+
+ // Starting to add items from last one, in reverse order,
+ // since TeleportHistory keeps most recent item at the end
mCurrentItem = mTeleportHistory->getItems().size() - 1;
for (S32 n = mItemContainers.size() - 1; n >= 0; --n)