From 0905d857614153e682032ab4630468708812707a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 15 Dec 2009 16:10:29 -0500 Subject: For EXT-3448: New attachments detach after relog. This fixes the most common problem, failing to create COF link to new attachment. --HG-- branch : avatar-pipeline --- indra/newview/llappearancemgr.cpp | 40 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index c06098689d..73fd50f9ea 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -871,10 +871,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 ) -- cgit v1.2.3 From e92a88159c7af972c8edd53e50d6ec2d3592a3dd Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 15 Dec 2009 17:29:05 -0500 Subject: For EXT-3448: New attachments detach after relog. Added a check that the only objects deleted by LLAppearanceManager are links. Probably not the cause of disappearing objects in this bug, but a good safety feature. --HG-- branch : avatar-pipeline --- indra/newview/llappearancemgr.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 73fd50f9ea..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()); + } } } @@ -947,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) @@ -996,10 +1002,9 @@ void LLAppearanceManager::removeCOFItemLinks(const LLUUID& item_id, bool do_upda for (S32 i=0; igetLinkedUUID() == 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) -- cgit v1.2.3 From 2dd09062d199ebfe7af8d67c59ec1bdc26e124a9 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 15 Dec 2009 17:33:59 -0500 Subject: menu separator fix --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 1b374a15a0..78e84c9216 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) -- cgit v1.2.3