diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-06-29 17:36:40 -0700 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-06-29 17:36:40 -0700 |
commit | 9366a7775c811b8f2e0ac24872d7d744ff2b54c5 (patch) | |
tree | 8074e9b3b65cc21b4753f1da7cf5d828c2195057 /indra | |
parent | 1bf7c4b645fb2eb307b2fb9541175569c4d8bcea (diff) |
PATH-797: BUGFIX Altering how the rows are being added to the scrolllist widget to avoid a regression that occurred after merging from viewer-release recently caused the time to load a large number of elements to increase substainally.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterpathfindingcharacters.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindinglinksets.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindingobjects.cpp | 36 |
3 files changed, 33 insertions, 23 deletions
diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp index 739e56a7c3..ef6388642a 100644 --- a/indra/newview/llfloaterpathfindingcharacters.cpp +++ b/indra/newview/llfloaterpathfindingcharacters.cpp @@ -205,17 +205,14 @@ LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListData(const LLPathfi columns[0]["column"] = "name"; columns[0]["value"] = pCharacterPtr->getName(); - columns[0]["font"] = "SANSSERIF"; columns[1]["column"] = "description"; columns[1]["value"] = pCharacterPtr->getDescription(); - columns[1]["font"] = "SANSSERIF"; columns[2]["column"] = "owner"; columns[2]["value"] = (pCharacterPtr->hasOwner() ? (pCharacterPtr->hasOwnerName() ? pCharacterPtr->getOwnerName() : getString("character_owner_loading")) : getString("character_owner_unknown")); - columns[2]["font"] = "SANSSERIF"; S32 cpuTime = llround(pCharacterPtr->getCPUTime()); std::string cpuTimeString = llformat("%d", cpuTime); @@ -224,11 +221,9 @@ LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListData(const LLPathfi columns[3]["column"] = "cpu_time"; columns[3]["value"] = getString("character_cpu_time", string_args); - columns[3]["font"] = "SANSSERIF"; columns[4]["column"] = "altitude"; columns[4]["value"] = llformat("%1.0f m", pCharacterPtr->getLocation()[2]); - columns[4]["font"] = "SANSSERIF"; LLSD element; element["id"] = pCharacterPtr->getUUID().asString(); diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index d6a08eeb23..9516b4b0c1 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -366,47 +366,37 @@ LLSD LLFloaterPathfindingLinksets::buildLinksetScrollListData(const LLPathfindin { columns[0]["column"] = "name"; columns[0]["value"] = getString("linkset_terrain_name"); - columns[0]["font"] = "SANSSERIF"; columns[1]["column"] = "description"; columns[1]["value"] = getString("linkset_terrain_description"); - columns[1]["font"] = "SANSSERIF"; columns[2]["column"] = "owner"; columns[2]["value"] = getString("linkset_terrain_owner"); - columns[2]["font"] = "SANSSERIF"; columns[3]["column"] = "land_impact"; columns[3]["value"] = getString("linkset_terrain_land_impact"); - columns[3]["font"] = "SANSSERIF"; columns[4]["column"] = "dist_from_you"; columns[4]["value"] = getString("linkset_terrain_dist_from_you"); - columns[4]["font"] = "SANSSERIF"; } else { columns[0]["column"] = "name"; columns[0]["value"] = pLinksetPtr->getName(); - columns[0]["font"] = "SANSSERIF"; columns[1]["column"] = "description"; columns[1]["value"] = pLinksetPtr->getDescription(); - columns[1]["font"] = "SANSSERIF"; columns[2]["column"] = "owner"; columns[2]["value"] = (pLinksetPtr->hasOwner() ? (pLinksetPtr->hasOwnerName() ? pLinksetPtr->getOwnerName() : getString("linkset_owner_loading")) : getString("linkset_owner_unknown")); - columns[2]["font"] = "SANSSERIF"; columns[3]["column"] = "land_impact"; columns[3]["value"] = llformat("%1d", pLinksetPtr->getLandImpact()); - columns[3]["font"] = "SANSSERIF"; columns[4]["column"] = "dist_from_you"; columns[4]["value"] = llformat("%1.0f m", dist_vec(pAvatarPosition, pLinksetPtr->getLocation())); - columns[4]["font"] = "SANSSERIF"; } columns[5]["column"] = "linkset_use"; @@ -428,23 +418,18 @@ LLSD LLFloaterPathfindingLinksets::buildLinksetScrollListData(const LLPathfindin linksetUse += (" " + getString("linkset_is_restricted_non_volume_state")); } columns[5]["value"] = linksetUse; - columns[5]["font"] = "SANSSERIF"; columns[6]["column"] = "a_percent"; columns[6]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientA()); - columns[6]["font"] = "SANSSERIF"; columns[7]["column"] = "b_percent"; columns[7]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientB()); - columns[7]["font"] = "SANSSERIF"; columns[8]["column"] = "c_percent"; columns[8]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientC()); - columns[8]["font"] = "SANSSERIF"; columns[9]["column"] = "d_percent"; columns[9]["value"] = llformat("%3d", pLinksetPtr->getWalkabilityCoefficientD()); - columns[9]["font"] = "SANSSERIF"; LLSD element; element["id"] = pLinksetPtr->getUUID().asString(); diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index 847997836b..e246265be9 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -41,10 +41,12 @@ #include "llcheckboxctrl.h" #include "llenvmanager.h" #include "llfloater.h" +#include "llfontgl.h" #include "llnotifications.h" #include "llnotificationsutil.h" #include "llpathfindingmanager.h" #include "llresmgr.h" +#include "llscrolllistcell.h" #include "llscrolllistctrl.h" #include "llscrolllistitem.h" #include "llselectmgr.h" @@ -346,10 +348,38 @@ void LLFloaterPathfindingObjects::rebuildObjectsScrollList() { LLSD scrollListData = convertObjectsIntoScrollListData(mObjectList); llassert(scrollListData.isArray()); - for (LLSD::array_const_iterator elementIter = scrollListData.beginArray(); elementIter != scrollListData.endArray(); ++elementIter) + + LLScrollListCell::Params cellParams; + cellParams.font = LLFontGL::getFontSansSerif(); + + for (LLSD::array_const_iterator rowElementIter = scrollListData.beginArray(); rowElementIter != scrollListData.endArray(); ++rowElementIter) { - const LLSD &element = *elementIter; - mObjectsScrollList->addElement(element); + const LLSD &rowElement = *rowElementIter; + + LLScrollListItem::Params rowParams; + llassert(rowElement.has("id")); + llassert(rowElement.get("id").isString()); + rowParams.value = rowElement.get("id"); + + llassert(rowElement.has("column")); + llassert(rowElement.get("column").isArray()); + const LLSD &columnElement = rowElement.get("column"); + for (LLSD::array_const_iterator cellIter = columnElement.beginArray(); cellIter != columnElement.endArray(); ++cellIter) + { + const LLSD &cellElement = *cellIter; + + llassert(cellElement.has("column")); + llassert(cellElement.get("column").isString()); + cellParams.column = cellElement.get("column").asString(); + + llassert(cellElement.has("value")); + llassert(cellElement.get("value").isString()); + cellParams.value = cellElement.get("value").asString(); + + rowParams.columns.add(cellParams); + } + + mObjectsScrollList->addRow(rowParams); } } |