summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-10-17 01:35:47 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-10-17 21:28:08 +0300
commite233e4fb50e513b58f4452086182b60b25440fac (patch)
treebf1f1b7695415bfe182936512cfd334fe4058670 /indra
parent7d82ee8075e81a6d3640103b68e98a6a2cbbe623 (diff)
SL-20232 Allow deletion of worn items #5
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llinventorybridge.cpp2
-rw-r--r--indra/newview/llinventoryfunctions.cpp15
-rw-r--r--indra/newview/llinventorygallery.cpp15
3 files changed, 21 insertions, 11 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 02ca331bff..a12c4f7f76 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -4504,7 +4504,7 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t&
return;
}
- if (!isItemRemovable())
+ if (!isItemRemovable(false))
{
disabled_items.push_back(std::string("Delete"));
}
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 849f641758..c2cbf4b8ac 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -3441,7 +3441,8 @@ void LLInventoryAction::onItemsRemovalConfirmation(const LLSD& notification, con
// removeSelectedItems will change selection, collect worn items beforehand
uuid_vec_t worn;
- uuid_vec_t deletion_list;
+ uuid_vec_t item_deletion_list;
+ uuid_vec_t cat_deletion_list;
if (has_worn)
{
//Get selected items
@@ -3473,14 +3474,14 @@ void LLInventoryAction::onItemsRemovalConfirmation(const LLSD& notification, con
}
if (cat_has_worn)
{
- deletion_list.push_back(obj_id);
+ cat_deletion_list.push_back(obj_id);
}
}
LLViewerInventoryItem* item = gInventory.getItem(obj_id);
if (item && get_is_item_worn(item))
{
worn.push_back(obj_id);
- deletion_list.push_back(obj_id);
+ item_deletion_list.push_back(obj_id);
}
}
}
@@ -3495,12 +3496,16 @@ void LLInventoryAction::onItemsRemovalConfirmation(const LLSD& notification, con
{
// should fire once after every item gets detached
LLAppearanceMgr::instance().removeItemsFromAvatar(worn,
- [deletion_list]()
+ [item_deletion_list, cat_deletion_list]()
{
- for (const LLUUID& id : deletion_list)
+ for (const LLUUID& id : item_deletion_list)
{
remove_inventory_item(id, NULL);
}
+ for (const LLUUID& id : cat_deletion_list)
+ {
+ remove_inventory_category(id, NULL);
+ }
});
}
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index 058bbde8b9..d5fce2cda7 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -1866,7 +1866,8 @@ void LLInventoryGallery::onDelete(const LLSD& notification, const LLSD& response
{
bool has_worn = notification["payload"]["has_worn"].asBoolean();
uuid_vec_t worn;
- uuid_vec_t deletion_list;
+ uuid_vec_t item_deletion_list;
+ uuid_vec_t cat_deletion_list;
for (const LLUUID& obj_id : selected_ids)
{
LLViewerInventoryCategory* cat = gInventory.getCategory(obj_id);
@@ -1891,7 +1892,7 @@ void LLInventoryGallery::onDelete(const LLSD& notification, const LLSD& response
}
if (cat_has_worn)
{
- deletion_list.push_back(obj_id);
+ cat_deletion_list.push_back(obj_id);
}
else
{
@@ -1904,7 +1905,7 @@ void LLInventoryGallery::onDelete(const LLSD& notification, const LLSD& response
if (has_worn && get_is_item_worn(item))
{
worn.push_back(item->getUUID());
- deletion_list.push_back(item->getUUID());
+ item_deletion_list.push_back(item->getUUID());
}
else
{
@@ -1917,12 +1918,16 @@ void LLInventoryGallery::onDelete(const LLSD& notification, const LLSD& response
{
// should fire once after every item gets detached
LLAppearanceMgr::instance().removeItemsFromAvatar(worn,
- [deletion_list]()
+ [item_deletion_list, cat_deletion_list]()
{
- for (const LLUUID& id : deletion_list)
+ for (const LLUUID& id : item_deletion_list)
{
remove_inventory_item(id, NULL);
}
+ for (const LLUUID& id : cat_deletion_list)
+ {
+ remove_inventory_category(id, NULL);
+ }
});
}
}