diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-11-18 14:51:14 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-11-18 14:51:14 -0500 |
commit | 5dea0791f7087f2ce2bbe2bdce49d62f1a6f1f92 (patch) | |
tree | 92c5fe1914e00891c23bfc4b7715b79b8ad2242b /indra/newview/llinventorymodel.cpp | |
parent | 2d82332479b3a8d8bdd869c14bdef03226e0b74f (diff) |
EXT-2581 : Old items still display as "(worn)" even after I change outfits
Added gInventory.notifyObservers to idle callbacks so it gets triggered without explicit notifyObservers synchronization.
Added more state tracking for attachments, wearables, and links of those types, so that they're marked as changed properly.
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r-- | indra/newview/llinventorymodel.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 84588fbe8c..fbaab385fe 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -509,7 +509,7 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id, } } -void LLInventoryModel::updateLinkedItems(const LLUUID& object_id) +void LLInventoryModel::addChangedMaskForLinks(const LLUUID& object_id, U32 mask) { const LLInventoryObject *obj = getObject(object_id); if (!obj || obj->getIsLinkType()) @@ -532,7 +532,7 @@ void LLInventoryModel::updateLinkedItems(const LLUUID& object_id) cat_iter++) { LLViewerInventoryCategory *linked_cat = (*cat_iter); - addChangedMask(LLInventoryObserver::LABEL, linked_cat->getUUID()); + addChangedMask(mask, linked_cat->getUUID()); }; for (LLInventoryModel::item_array_t::iterator iter = item_array.begin(); @@ -540,9 +540,8 @@ void LLInventoryModel::updateLinkedItems(const LLUUID& object_id) iter++) { LLViewerInventoryItem *linked_item = (*iter); - addChangedMask(LLInventoryObserver::LABEL, linked_item->getUUID()); + addChangedMask(mask, linked_item->getUUID()); }; - notifyObservers(); } const LLUUID& LLInventoryModel::getLinkedItemID(const LLUUID& object_id) const @@ -1133,6 +1132,14 @@ void LLInventoryModel::notifyObservers(const std::string service_name) llwarns << "Call was made to notifyObservers within notifyObservers!" << llendl; 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(); ) @@ -1180,7 +1187,7 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent) // not sure what else might need to be accounted for this. if (mModifyMask & LLInventoryObserver::LABEL) { - updateLinkedItems(referent); + addChangedMaskForLinks(referent, LLInventoryObserver::LABEL); } } |