diff options
| author | Oz Linden <oz@lindenlab.com> | 2017-05-23 04:56:13 -0400 |
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2017-05-23 04:56:13 -0400 |
| commit | 069dd355f90116b500065b40bfb36622be1faee5 (patch) | |
| tree | fe6cf12e89a715f46cf4e95ad91a5cf7f0e0c8a9 /indra/newview/llappearancemgr.cpp | |
| parent | f9e049c9e5cc01b464e66cab3e34e33864946c0c (diff) | |
| parent | 48af8529a80052e9bc42f81f36896739f8aff861 (diff) | |
merge changes for 5.0.5-release
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
| -rw-r--r-- | indra/newview/llappearancemgr.cpp | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index feb981217d..c928cf0601 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2917,11 +2917,32 @@ void LLAppearanceMgr::removeAllAttachmentsFromAvatar() removeItemsFromAvatar(ids_to_remove); } -void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb) +class LLUpdateOnCOFLinkRemove : public LLInventoryCallback { - gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); +public: + LLUpdateOnCOFLinkRemove(const LLUUID& remove_item_id, LLPointer<LLInventoryCallback> cb = NULL): + mItemID(remove_item_id), + mCB(cb) + { + } - LLInventoryModel::cat_array_t cat_array; + /* virtual */ void fire(const LLUUID& item_id) + { + // just removed cof link, "(wear)" suffix depends on presence of link, so update label + gInventory.addChangedMask(LLInventoryObserver::LABEL, mItemID); + if (mCB.notNull()) + { + mCB->fire(item_id); + } + } + +private: + LLUUID mItemID; + LLPointer<LLInventoryCallback> mCB; +}; + +void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id, LLPointer<LLInventoryCallback> cb) +{ LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; gInventory.collectDescendents(LLAppearanceMgr::getCOF(), cat_array, @@ -2932,12 +2953,20 @@ void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id, LLPointer<LLInve const LLInventoryItem* item = item_array.at(i).get(); if (item->getIsLinkType() && item->getLinkedUUID() == item_id) { - bool immediate_delete = false; if (item->getType() == LLAssetType::AT_OBJECT) { - immediate_delete = true; + // Immediate delete + remove_inventory_item(item->getUUID(), cb, true); + gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); + } + else + { + // Delayed delete + // Pointless to update item_id label here since link still exists and first notifyObservers + // call will restore (wear) suffix, mark for update after deletion + LLPointer<LLUpdateOnCOFLinkRemove> cb_label = new LLUpdateOnCOFLinkRemove(item_id, cb); + remove_inventory_item(item->getUUID(), cb_label, false); } - remove_inventory_item(item->getUUID(), cb, immediate_delete); } } } |
