From 6474dbd46920fe704625a44cc2b8c56bfdca4990 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Tue, 17 Nov 2009 16:07:29 -0500
Subject: [PATCH] For DEV-34652: OUTFITS (Operations) : Wear folders via drag
 and drop - handle untyped folder dragged to outfit

--HG--
branch : avatar-pipeline
---
 indra/newview/llappearancemgr.cpp   | 2 +-
 indra/newview/llappearancemgr.h     | 8 +++++---
 indra/newview/llinventorybridge.cpp | 8 ++++++++
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 09efda6aca4..48f11a7cf5d 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -465,7 +465,7 @@ void LLAppearanceManager::filterWearableItems(
 // Create links to all listed items.
 void LLAppearanceManager::linkAll(const LLUUID& category,
 								  LLInventoryModel::item_array_t& items,
-											   LLPointer<LLInventoryCallback> cb)
+								  LLPointer<LLInventoryCallback> cb)
 {
 	for (S32 i=0; i<items.count(); i++)
 	{
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index f39fbd7b1a9..12ffa336b45 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -82,6 +82,11 @@ class LLAppearanceManager: public LLSingleton<LLAppearanceManager>
 	void setAttachmentInvLinkEnable(bool val);
 	void linkRegisteredAttachments();
 
+	// utility function for bulk linking.
+	void linkAll(const LLUUID& category,
+				 LLInventoryModel::item_array_t& items,
+				 LLPointer<LLInventoryCallback> cb);
+
 protected:
 	LLAppearanceManager();
 	~LLAppearanceManager();
@@ -89,9 +94,6 @@ class LLAppearanceManager: public LLSingleton<LLAppearanceManager>
 private:
 
 	void filterWearableItems(LLInventoryModel::item_array_t& items, S32 max_per_type);
-	void linkAll(const LLUUID& category,
-						LLInventoryModel::item_array_t& items,
-						LLPointer<LLInventoryCallback> cb);
 	
 	void getDescendentsOfAssetType(const LLUUID& category, 
 										  LLInventoryModel::item_array_t& items,
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index aa38b19c5e9..8b7a84a3d33 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1680,6 +1680,14 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 						BOOL append = true;
 						LLAppearanceManager::instance().wearInventoryCategory(inv_cat, false, append);
 					}
+					else
+					{
+						// Recursively create links in target outfit.
+						LLInventoryModel::cat_array_t cats;
+						LLInventoryModel::item_array_t items;
+						gInventory.collectDescendents(inv_cat->getUUID(), cats, items, LLInventoryModel::EXCLUDE_TRASH);
+						LLAppearanceManager::instance().linkAll(mUUID,items,NULL);
+					}
 				}
 				else
 				{
-- 
GitLab