summaryrefslogtreecommitdiff
path: root/indra/newview/llappearancemgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappearancemgr.cpp')
-rw-r--r--indra/newview/llappearancemgr.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 0fe236c056..6c4c59c4e7 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -519,9 +519,31 @@ void LLAppearanceManager::changeOutfit(bool proceed, const LLUUID& category, boo
LLAppearanceManager::instance().updateCOF(category,append);
}
+// Create a copy of src_id + contents as a subfolder of dst_id.
void LLAppearanceManager::shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id,
LLPointer<LLInventoryCallback> cb)
{
+ LLInventoryCategory *src_cat = gInventory.getCategory(src_id);
+ if (!src_cat)
+ {
+ llwarns << "folder not found for src " << src_id.asString() << llendl;
+ return;
+ }
+ LLUUID parent_id = dst_id;
+ if(parent_id.isNull())
+ {
+ parent_id = gInventory.getRootFolderID();
+ }
+ LLUUID subfolder_id = gInventory.createNewCategory( parent_id,
+ LLFolderType::FT_NONE,
+ src_cat->getName());
+ shallowCopyCategoryContents(src_id, subfolder_id, cb);
+}
+
+// Copy contents of src_id to dst_id.
+void LLAppearanceManager::shallowCopyCategoryContents(const LLUUID& src_id, const LLUUID& dst_id,
+ LLPointer<LLInventoryCallback> cb)
+{
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
gInventory.collectDescendents(src_id, cats, items,