summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llappearancemgr.cpp55
-rw-r--r--indra/newview/llinventorybridge.cpp5
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)