diff options
author | Cho <cho@lindenlab.com> | 2014-04-22 00:52:45 +0100 |
---|---|---|
committer | Cho <cho@lindenlab.com> | 2014-04-22 00:52:45 +0100 |
commit | 4cb9fa2954cbce36d7d02624cd4ba37cc3f969b5 (patch) | |
tree | debe8ccb3f67a65d82aaacbcaed0911bf779ef53 | |
parent | 54a90871906bcb72f9cd216ea437d59893b099aa (diff) |
Sorted Experience Events with most recent first for ACME-1431
-rw-r--r-- | indra/newview/llpanelexperiencelog.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/indra/newview/llpanelexperiencelog.cpp b/indra/newview/llpanelexperiencelog.cpp index 0c9f57b336..5d049beec3 100644 --- a/indra/newview/llpanelexperiencelog.cpp +++ b/indra/newview/llpanelexperiencelog.cpp @@ -112,10 +112,19 @@ void LLPanelExperienceLog::refresh() int itemsToSkip = mPageSize*mCurrentPage; int items = 0; bool moreItems = false; - + + LLSD daysArray = LLSD::emptyArray(); for(LLSD::map_const_iterator day = events.beginMap(); day != events.endMap() ; ++day) { - const LLSD& dayArray = day->second; + LLSD dayMap = LLSD::emptyMap(); + dayMap["day"] = day->first; + dayMap["data"] = day->second; + daysArray.append(dayMap); + } + + for(LLSD::reverse_array_iterator day = daysArray.rbeginArray(); day != daysArray.rendArray() ; ++day) + { + const LLSD& dayArray = day->get("data"); int size = dayArray.size(); if(itemsToSkip > size) { @@ -127,7 +136,7 @@ void LLPanelExperienceLog::refresh() moreItems = true; break; } - for(int i = itemsToSkip ; i < dayArray.size(); i++) + for(int i = dayArray.size() - itemsToSkip - 1; i >= 0; i--) { if(items >= mPageSize) { @@ -147,7 +156,7 @@ void LLPanelExperienceLog::refresh() LLSD& columns = item["columns"]; columns[0]["column"] = "time"; - columns[0]["value"] = day->first+event["Time"].asString(); + columns[0]["value"] = day->get("day").asString()+event["Time"].asString(); columns[1]["column"] = "event"; columns[1]["value"] = LLExperienceLog::getPermissionString(event, "ExperiencePermissionShort"); columns[2]["column"] = "experience_name"; |