diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-12-15 19:17:30 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-12-15 19:17:30 -0500 |
commit | 4d4406820b858d59be670f0ca03bdadefba61c53 (patch) | |
tree | a88f0a6b544ff95bf6cb2b70ef9a9d90354cfa09 /indra/newview | |
parent | a162d6afdae3c15641f90cee8aae29ea9e92dd98 (diff) | |
parent | 2dd09062d199ebfe7af8d67c59ec1bdc26e124a9 (diff) |
automated merge avp->avp
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llappearancemgr.cpp | 55 | ||||
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 5 |
2 files changed, 53 insertions, 7 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index c06098689d..43b2f34ecd 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -455,7 +455,10 @@ void LLAppearanceManager::purgeCategory(const LLUUID& category, bool keep_outfit LLViewerInventoryItem *item = items.get(i); if (keep_outfit_links && (item->getActualType() == LLAssetType::AT_LINK_FOLDER)) continue; - gInventory.purgeObject(item->getUUID()); + if (item->getIsLinkType()) + { + gInventory.purgeObject(item->getUUID()); + } } } @@ -871,10 +874,48 @@ bool areMatchingWearables(const LLViewerInventoryItem *a, const LLViewerInventor (a->getWearableType() == b->getWearableType())); } +class LLDeferredCOFLinkObserver: public LLInventoryObserver +{ +public: + LLDeferredCOFLinkObserver(const LLUUID& item_id, bool do_update): + mItemID(item_id), + mDoUpdate(do_update) + { + } + + ~LLDeferredCOFLinkObserver() + { + } + + /* virtual */ void changed(U32 mask) + { + const LLInventoryItem *item = gInventory.getItem(mItemID); + if (item) + { + gInventory.removeObserver(this); + LLAppearanceManager::instance().addCOFItemLink(item,mDoUpdate); + delete this; + } + } + +private: + const LLUUID mItemID; + bool mDoUpdate; +}; + + void LLAppearanceManager::addCOFItemLink(const LLUUID &item_id, bool do_update ) { const LLInventoryItem *item = gInventory.getItem(item_id); - addCOFItemLink(item, do_update); + if (!item) + { + LLDeferredCOFLinkObserver *observer = new LLDeferredCOFLinkObserver(item_id, do_update); + gInventory.addObserver(observer); + } + else + { + addCOFItemLink(item, do_update); + } } void LLAppearanceManager::addCOFItemLink(const LLInventoryItem *item, bool do_update ) @@ -909,7 +950,10 @@ void LLAppearanceManager::addCOFItemLink(const LLInventoryItem *item, bool do_up else if (areMatchingWearables(vitem,inv_item)) { gAgentWearables.removeWearable(inv_item->getWearableType(),true,0); - gInventory.purgeObject(inv_item->getUUID()); + if (inv_item->getIsLinkType()) + { + gInventory.purgeObject(inv_item->getUUID()); + } } } if (linked_already) @@ -958,10 +1002,9 @@ void LLAppearanceManager::removeCOFItemLinks(const LLUUID& item_id, bool do_upda for (S32 i=0; i<item_array.count(); i++) { const LLInventoryItem* item = item_array.get(i).get(); - if (item->getLinkedUUID() == item_id) + if (item->getIsLinkType() && item->getLinkedUUID() == item_id) { - const LLUUID& item_id = item_array.get(i)->getUUID(); - gInventory.purgeObject(item_id); + gInventory.purgeObject(item->getUUID()); } } if (do_update) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 050676c242..bacc685130 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2496,7 +2496,10 @@ void LLFolderBridge::folderOptionsMenu() checkFolderForContentsOfType(model, is_object) || checkFolderForContentsOfType(model, is_gesture) ) { - mItems.push_back(std::string("Folder Wearables Separator")); + if (!is_sidepanel) + { + mItems.push_back(std::string("Folder Wearables Separator")); + } // Only enable add/replace outfit for non-default folders. if (!is_default_folder) |