diff options
author | James Cook <james@lindenlab.com> | 2009-11-25 12:31:24 -0800 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2009-11-25 12:31:24 -0800 |
commit | 957055396d2ffa3a76b09c60cb9c3e1f73870cbf (patch) | |
tree | 632ecbdc0c21b0e14eb72f74faa8c04765f54489 /indra/newview/llinventorymodel.cpp | |
parent | ef46d4077ca4aad322aabfe545885be136577c8a (diff) | |
parent | 59eb8a43a467ecaa5a8c2b58bf1abfb8350c0202 (diff) |
merge in changes from viewer-2-0, manually fixed conflict in llviewermessages.cpp
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r-- | indra/newview/llinventorymodel.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 4ece876192..9f96ebc366 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1119,9 +1119,16 @@ BOOL LLInventoryModel::containsObserver(LLInventoryObserver* observer) const return mObservers.find(observer) != mObservers.end(); } -// Call this method when it's time to update everyone on a new state, -// by default, the inventory model will not update observers -// automatically. +void LLInventoryModel::idleNotifyObservers() +{ + if (mModifyMask == LLInventoryObserver::NONE && (mChangedItemIDs.size() == 0)) + { + return; + } + notifyObservers(""); +} + +// Call this method when it's time to update everyone on a new state. // The optional argument 'service_name' is used by Agent Inventory Service [DEV-20328] void LLInventoryModel::notifyObservers(const std::string service_name) { @@ -1134,13 +1141,6 @@ void LLInventoryModel::notifyObservers(const std::string service_name) return; } - if ((mModifyMask == LLInventoryObserver::NONE) && (service_name == "")) - { - mModifyMask = LLInventoryObserver::NONE; - mChangedItemIDs.clear(); - return; - } - mIsNotifyObservers = TRUE; for (observer_list_t::iterator iter = mObservers.begin(); iter != mObservers.end(); ) @@ -3309,8 +3309,7 @@ void LLInventoryModel::processInventoryDescendents(LLMessageSystem* msg,void**) msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); if(agent_id != gAgent.getID()) { - llwarns << "Got a UpdateInventoryItem for the wrong agent." - << llendl; + llwarns << "Got a UpdateInventoryItem for the wrong agent." << llendl; return; } LLUUID parent_id; @@ -3321,6 +3320,7 @@ void LLInventoryModel::processInventoryDescendents(LLMessageSystem* msg,void**) msg->getS32("AgentData", "Version", version); S32 descendents; msg->getS32("AgentData", "Descendents", descendents); + S32 i; S32 count = msg->getNumberOfBlocksFast(_PREHASH_FolderData); LLPointer<LLViewerInventoryCategory> tcategory = new LLViewerInventoryCategory(owner_id); @@ -3350,6 +3350,9 @@ void LLInventoryModel::processInventoryDescendents(LLMessageSystem* msg,void**) { cat->setVersion(version); cat->setDescendentCount(descendents); + // Get this UUID on the changed list so that whatever's listening for it + // will get triggered. + gInventory.addChangedMask(LLInventoryObserver::INTERNAL, cat->getUUID()); } gInventory.notifyObservers(); } |