diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-10-17 01:35:47 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-10-17 21:28:08 +0300 |
commit | e233e4fb50e513b58f4452086182b60b25440fac (patch) | |
tree | bf1f1b7695415bfe182936512cfd334fe4058670 /indra/newview/llinventorygallery.cpp | |
parent | 7d82ee8075e81a6d3640103b68e98a6a2cbbe623 (diff) |
SL-20232 Allow deletion of worn items #5
Diffstat (limited to 'indra/newview/llinventorygallery.cpp')
-rw-r--r-- | indra/newview/llinventorygallery.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
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); + } }); } } |