summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r--indra/newview/llinventoryfunctions.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 9967318e92..1077ce74ae 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -438,7 +438,13 @@ void copy_inventory_category(LLInventoryModel* model,
{
copy_inventory_category_content(new_id, model, cat, root_copy_id, move_no_copy_items);
};
- gInventory.createNewCategory(parent_id, LLFolderType::FT_NONE, cat->getName(), func, cat->getThumbnailUUID());
+ LLFolderType::EType type = LLFolderType::FT_NONE;
+ if (cat->getPreferredType() == LLFolderType::FT_OUTFIT)
+ {
+ // at the moment only permitting copy of outfits and normal folders
+ type = LLFolderType::FT_OUTFIT;
+ }
+ gInventory.createNewCategory(parent_id, type, cat->getName(), func, cat->getThumbnailUUID());
}
void copy_inventory_category(LLInventoryModel* model,
@@ -460,6 +466,25 @@ void copy_inventory_category(LLInventoryModel* model,
gInventory.createNewCategory(parent_id, LLFolderType::FT_NONE, cat->getName(), func, cat->getThumbnailUUID());
}
+void copy_inventory_category(LLInventoryModel* model,
+ LLViewerInventoryCategory* cat,
+ const LLUUID& parent_id,
+ const LLUUID& root_copy_id,
+ bool move_no_copy_items,
+ LLPointer<LLInventoryCallback> callback)
+{
+ // Create the initial folder
+ inventory_func_type func = [model, cat, root_copy_id, move_no_copy_items, callback](const LLUUID& new_id)
+ {
+ copy_inventory_category_content(new_id, model, cat, root_copy_id, move_no_copy_items);
+ if (callback)
+ {
+ callback.get()->fire(new_id);
+ }
+ };
+ gInventory.createNewCategory(parent_id, LLFolderType::FT_NONE, cat->getName(), func, cat->getThumbnailUUID());
+}
+
void copy_cb(const LLUUID& dest_folder, const LLUUID& root_id)
{
// Decrement the count in root_id since that one item won't be copied over
@@ -2365,6 +2390,12 @@ bool can_move_to_my_outfits_as_subfolder(LLInventoryModel* model, LLInventoryCat
return false;
}
+ if (inv_cat->getPreferredType() != LLFolderType::FT_NONE)
+ {
+ // only normal folders can become subfodlers
+ return false;
+ }
+
constexpr size_t MAX_CONTENT = 255;
if (cats->size() > MAX_CONTENT)
{