diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-02-23 17:12:44 -0800 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-02-23 17:12:44 -0800 |
commit | 05a49dd4252930fbfbb61a7e88ef5ef253cceca6 (patch) | |
tree | 47d61abc1f17d77cbd1b07281627a52808b677e4 /indra | |
parent | 73aa47f391341e6d6ef5136ef73302be689d3e9d (diff) |
PATH-292: Fixing the post-modify update handler to update the linkset list rather than overwrite it.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterpathfindinglinksets.cpp | 22 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindinglinksets.h | 1 | ||||
-rw-r--r-- | indra/newview/llpathfindinglinksetlist.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llpathfindinglinksetlist.h | 2 |
4 files changed, 32 insertions, 12 deletions
diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index 73ab01a89f..2b3007b435 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -320,7 +320,7 @@ void LLFloaterPathfindingLinksets::requestSetLinksets(LLPathfindingLinksetListPt llassert(!isMessagingInProgress());
if (!isMessagingInProgress())
{
- switch (LLPathfindingManager::getInstance()->requestSetLinksets(pLinksetList, pLinksetUse, pA, pB, pC, pD, boost::bind(&LLFloaterPathfindingLinksets::handleNewLinksets, this, _1, _2)))
+ switch (LLPathfindingManager::getInstance()->requestSetLinksets(pLinksetList, pLinksetUse, pA, pB, pC, pD, boost::bind(&LLFloaterPathfindingLinksets::handleUpdateLinksets, this, _1, _2)))
{
case LLPathfindingManager::kLinksetsRequestStarted :
setMessagingState(kMessagingSetRequestSent);
@@ -359,6 +359,26 @@ void LLFloaterPathfindingLinksets::handleNewLinksets(LLPathfindingManager::ELink }
}
+void LLFloaterPathfindingLinksets::handleUpdateLinksets(LLPathfindingManager::ELinksetsRequestStatus pLinksetsRequestStatus, LLPathfindingLinksetListPtr pLinksetsListPtr)
+{
+ mLinksetsListPtr->update(*pLinksetsListPtr);
+ updateScrollList();
+
+ switch (pLinksetsRequestStatus)
+ {
+ case LLPathfindingManager::kLinksetsRequestCompleted :
+ setMessagingState(kMessagingComplete);
+ break;
+ case LLPathfindingManager::kLinksetsRequestError :
+ setMessagingState(kMessagingSetError);
+ break;
+ default :
+ setMessagingState(kMessagingSetError);
+ llassert(0);
+ break;
+ }
+}
+
void LLFloaterPathfindingLinksets::onApplyAllFilters()
{
applyFilters();
diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h index f4758e2335..abbc355f46 100644 --- a/indra/newview/llfloaterpathfindinglinksets.h +++ b/indra/newview/llfloaterpathfindinglinksets.h @@ -113,6 +113,7 @@ private: void requestGetLinksets();
void requestSetLinksets(LLPathfindingLinksetListPtr pLinksetList, LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD);
void handleNewLinksets(LLPathfindingManager::ELinksetsRequestStatus pLinksetsRequestStatus, LLPathfindingLinksetListPtr pLinksetsListPtr);
+ void handleUpdateLinksets(LLPathfindingManager::ELinksetsRequestStatus pLinksetsRequestStatus, LLPathfindingLinksetListPtr pLinksetsListPtr);
void onApplyAllFilters();
void onClearFiltersClicked();
diff --git a/indra/newview/llpathfindinglinksetlist.cpp b/indra/newview/llpathfindinglinksetlist.cpp index e67b7b800c..7facf88c40 100644 --- a/indra/newview/llpathfindinglinksetlist.cpp +++ b/indra/newview/llpathfindinglinksetlist.cpp @@ -62,24 +62,23 @@ LLPathfindingLinksetList::~LLPathfindingLinksetList() clear();
}
-void LLPathfindingLinksetList::update(const LLSD& pLinksetItems)
+void LLPathfindingLinksetList::update(const LLPathfindingLinksetList &pUpdateLinksetList)
{
- for (LLSD::map_const_iterator linksetItemIter = pLinksetItems.beginMap();
- linksetItemIter != pLinksetItems.endMap(); ++linksetItemIter)
+ for (LLPathfindingLinksetList::const_iterator updateLinksetIter = pUpdateLinksetList.begin();
+ updateLinksetIter != pUpdateLinksetList.end(); ++updateLinksetIter)
{
- const std::string& uuid(linksetItemIter->first);
- const LLSD& linksetData = linksetItemIter->second;
- LLPathfindingLinksetMap::iterator linksetIter = this->find(uuid);
+ const std::string &uuid = updateLinksetIter->first;
+ const LLPathfindingLinksetPtr updateLinksetPtr = updateLinksetIter->second;
+
+ LLPathfindingLinksetList::iterator linksetIter = find(uuid);
if (linksetIter == end())
{
- LLPathfindingLinksetPtr linkset(new LLPathfindingLinkset(uuid, linksetData));
- insert(std::pair<std::string, LLPathfindingLinksetPtr>(uuid, linkset));
+ insert(std::pair<std::string, LLPathfindingLinksetPtr>(uuid, updateLinksetPtr));
}
else
{
LLPathfindingLinksetPtr linksetPtr = linksetIter->second;
- const LLPathfindingLinkset newLinkset(uuid, linksetData);
- *linksetPtr = newLinkset;
+ *linksetPtr = *updateLinksetPtr;
}
}
}
diff --git a/indra/newview/llpathfindinglinksetlist.h b/indra/newview/llpathfindinglinksetlist.h index 9ec36c2431..443f331770 100644 --- a/indra/newview/llpathfindinglinksetlist.h +++ b/indra/newview/llpathfindinglinksetlist.h @@ -47,7 +47,7 @@ public: LLPathfindingLinksetList(const LLSD& pLinksetItems);
virtual ~LLPathfindingLinksetList();
- void update(const LLSD& pLinksetItems);
+ void update(const LLPathfindingLinksetList &pUpdateLinksetList);
LLSD encodeAlteredFields(LLPathfindingLinkset::ELinksetUse pLinksetUse, S32 pA, S32 pB, S32 pC, S32 pD) const;
|