diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2009-11-03 12:22:31 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2009-11-03 12:22:31 -0500 |
commit | 9109809fb18968edfcd8e8f01428309fcc2e7578 (patch) | |
tree | e864c3bd873d637fe2796fc52e0e85a614726ece /indra/newview/llappearancemgr.cpp | |
parent | 7add9de18f3964f0c52f68931bfcb88b9f81966c (diff) |
For EXT-1591: Current Outfit Folder contains duplicate attachment items after relog.
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r-- | indra/newview/llappearancemgr.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index c297f8db29..8d0f11e021 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1181,6 +1181,14 @@ void LLAppearanceManager::dumpItemArray(const LLInventoryModel::item_array_t& it std::set<LLUUID> LLAppearanceManager::sRegisteredAttachments; +bool LLAppearanceManager::sAttachmentInvLinkEnabled(false); + +/* static */ +void LLAppearanceManager::setAttachmentInvLinkEnable(bool val) +{ + llinfos << "setAttachmentInvLinkEnable => " << (int) val << llendl; + sAttachmentInvLinkEnabled = val; +} void dumpAttachmentSet(const std::set<LLUUID>& atts, const std::string& msg) { @@ -1204,6 +1212,22 @@ void LLAppearanceManager::registerAttachment(const LLUUID& item_id) { sRegisteredAttachments.insert(item_id); dumpAttachmentSet(sRegisteredAttachments,"after register:"); + + if (sAttachmentInvLinkEnabled) + { + LLViewerInventoryItem *item = gInventory.getItem(item_id); + if (item) + { + LLAppearanceManager::dumpCat(LLAppearanceManager::getCOF(),"Adding attachment link:"); + LLAppearanceManager::wearItem(item,false); // Add COF link for item. + gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); + gInventory.notifyObservers(); + } + } + else + { + llinfos << "no link changes, inv link not enabled" << llendl; + } } /* static */ @@ -1211,4 +1235,17 @@ void LLAppearanceManager::unregisterAttachment(const LLUUID& item_id) { sRegisteredAttachments.erase(item_id); dumpAttachmentSet(sRegisteredAttachments,"after unregister:"); + + if (sAttachmentInvLinkEnabled) + { + LLAppearanceManager::dumpCat(LLAppearanceManager::getCOF(),"Removing attachment link:"); + LLAppearanceManager::removeItemLinks(item_id, false); + // BAP - needs to change for label to track link. + gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); + gInventory.notifyObservers(); + } + else + { + llinfos << "no link changes, inv link not enabled" << llendl; + } } |