summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpathfindinglinksets.cpp
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-01-19 13:28:16 -0800
committerTodd Stinson <stinson@lindenlab.com>2012-01-19 13:28:16 -0800
commit755ba8652bfdc74162c97dff9ea4c74a7a74ae81 (patch)
tree5dadf1b1b86e98a27820cb022e09d20ae08427f9 /indra/newview/llfloaterpathfindinglinksets.cpp
parent146f0c25504cc16458cb20312eba63b04d26389d (diff)
PATH-227: Adding code to update the scroll list after a PUT response.
Diffstat (limited to 'indra/newview/llfloaterpathfindinglinksets.cpp')
-rw-r--r--indra/newview/llfloaterpathfindinglinksets.cpp39
1 files changed, 31 insertions, 8 deletions
diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp
index e24703aca6..2b13d64937 100644
--- a/indra/newview/llfloaterpathfindinglinksets.cpp
+++ b/indra/newview/llfloaterpathfindinglinksets.cpp
@@ -383,7 +383,7 @@ PathfindingLinksets::PathfindingLinksets(const LLSD& pNavMeshData)
mIsFixedFilter(false),
mIsWalkableFilter(false)
{
- parseNavMeshData(pNavMeshData);
+ setNavMeshData(pNavMeshData);
}
PathfindingLinksets::PathfindingLinksets(const PathfindingLinksets& pOther)
@@ -402,15 +402,15 @@ PathfindingLinksets::~PathfindingLinksets()
clearLinksets();
}
-void PathfindingLinksets::parseNavMeshData(const LLSD& pNavMeshData)
+void PathfindingLinksets::setNavMeshData(const LLSD& pNavMeshData)
{
clearLinksets();
- for (LLSD::map_const_iterator linksetIter = pNavMeshData.beginMap();
- linksetIter != pNavMeshData.endMap(); ++linksetIter)
+ for (LLSD::map_const_iterator navMeshDataIter = pNavMeshData.beginMap();
+ navMeshDataIter != pNavMeshData.endMap(); ++navMeshDataIter)
{
- const std::string& uuid(linksetIter->first);
- const LLSD& linksetData = linksetIter->second;
+ const std::string& uuid(navMeshDataIter->first);
+ const LLSD& linksetData = navMeshDataIter->second;
PathfindingLinkset linkset(uuid, linksetData);
mAllLinksets.insert(std::pair<std::string, PathfindingLinkset>(uuid, linkset));
@@ -419,6 +419,29 @@ void PathfindingLinksets::parseNavMeshData(const LLSD& pNavMeshData)
mIsFiltersDirty = true;
}
+void PathfindingLinksets::updateNavMeshData(const LLSD& pNavMeshData)
+{
+ for (LLSD::map_const_iterator navMeshDataIter = pNavMeshData.beginMap();
+ navMeshDataIter != pNavMeshData.endMap(); ++navMeshDataIter)
+ {
+ const std::string& uuid(navMeshDataIter->first);
+ const LLSD& linksetData = navMeshDataIter->second;
+ PathfindingLinkset linkset(uuid, linksetData);
+
+ PathfindingLinksetMap::iterator linksetIter = mAllLinksets.find(uuid);
+ if (linksetIter == mAllLinksets.end())
+ {
+ mAllLinksets.insert(std::pair<std::string, PathfindingLinkset>(uuid, linkset));
+ }
+ else
+ {
+ linksetIter->second = linkset;
+ }
+ }
+
+ mIsFiltersDirty = true;
+}
+
void PathfindingLinksets::clearLinksets()
{
mAllLinksets.clear();
@@ -725,7 +748,7 @@ void LLFloaterPathfindingLinksets::sendNavMeshDataPutRequest(const LLSD& pPostDa
void LLFloaterPathfindingLinksets::handleNavMeshDataGetReply(const LLSD& pNavMeshData)
{
setFetchState(kFetchReceived);
- mPathfindingLinksets.parseNavMeshData(pNavMeshData);
+ mPathfindingLinksets.setNavMeshData(pNavMeshData);
updateLinksetsList();
setFetchState(kFetchComplete);
}
@@ -741,7 +764,7 @@ void LLFloaterPathfindingLinksets::handleNavMeshDataGetError(const std::string&
void LLFloaterPathfindingLinksets::handleNavMeshDataPutReply(const LLSD& pModifiedData)
{
setFetchState(kFetchReceived);
- mPathfindingLinksets.parseNavMeshData(pModifiedData);
+ mPathfindingLinksets.updateNavMeshData(pModifiedData);
updateLinksetsList();
setFetchState(kFetchComplete);
}