Commits

Anonymous committed e2193f1 Merge

automated merge avp->avp

Comments (0)

Files changed (2)

indra/newview/llappearancemgr.cpp

 		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());
+		}
 	}
 }
 
 			(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 )
 		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)
 	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)

indra/newview/llinventorybridge.cpp

 		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)