From ed249c13af3509645089b280d3a594c29c216f68 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 19 May 2017 17:50:17 +0300 Subject: MAINT-7383 Show correct number of items including folder descendants --- indra/newview/llinventorypanel.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 4b117941a0..5a7881fe49 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1217,7 +1217,16 @@ void LLInventoryPanel::purgeSelectedItems() const std::set inventory_selected = mFolderRoot.get()->getSelectionList(); if (inventory_selected.empty()) return; LLSD args; - args["COUNT"] = (S32)inventory_selected.size(); + S32 count = inventory_selected.size(); + static const U32 trash_max_capacity = gSavedSettings.getU32("InventoryTrashMaxCapacity"); + for (std::set::const_iterator it = inventory_selected.begin(), end_it = inventory_selected.end(); + it != end_it; + ++it) + { + LLUUID item_id = static_cast((*it)->getViewModelItem())->getUUID(); + count += gInventory.getDescendentsCountRecursive(item_id, trash_max_capacity); + } + args["COUNT"] = count; LLNotificationsUtil::add("PurgeSelectedItems", args, LLSD(), boost::bind(&LLInventoryPanel::callbackPurgeSelectedItems, this, _1, _2)); } -- cgit v1.2.3 From c7dde30435c578b8fd4606135193e3ec8d31bd76 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 19 May 2017 18:47:20 +0300 Subject: MAINT-7424 Fixed number of items in the Trash not calculating correctly --- indra/newview/llinventorypanel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 5a7881fe49..ba2dce1f98 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1224,7 +1224,10 @@ void LLInventoryPanel::purgeSelectedItems() ++it) { LLUUID item_id = static_cast((*it)->getViewModelItem())->getUUID(); - count += gInventory.getDescendentsCountRecursive(item_id, trash_max_capacity); + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + gInventory.collectDescendents(item_id, cats, items, LLInventoryModel::INCLUDE_TRASH); + count += items.size() + cats.size(); } args["COUNT"] = count; LLNotificationsUtil::add("PurgeSelectedItems", args, LLSD(), boost::bind(&LLInventoryPanel::callbackPurgeSelectedItems, this, _1, _2)); -- cgit v1.2.3 From c102bcf0adc45f855f103831542b019ad60702e7 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 22 May 2017 11:44:41 +0300 Subject: build fix --- indra/newview/llinventorypanel.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index ba2dce1f98..f9c91312ee 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1218,7 +1218,6 @@ void LLInventoryPanel::purgeSelectedItems() if (inventory_selected.empty()) return; LLSD args; S32 count = inventory_selected.size(); - static const U32 trash_max_capacity = gSavedSettings.getU32("InventoryTrashMaxCapacity"); for (std::set::const_iterator it = inventory_selected.begin(), end_it = inventory_selected.end(); it != end_it; ++it) -- cgit v1.2.3