diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2017-05-19 17:50:17 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2017-05-19 17:50:17 +0300 |
commit | ed249c13af3509645089b280d3a594c29c216f68 (patch) | |
tree | d57d289bc9b31f15bdce68fecb2836f9ac9de31f /indra | |
parent | c7d7728e4a4caadac1875856d77b752bc36a2f56 (diff) |
MAINT-7383 Show correct number of items including folder descendants
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llinventorymodel.h | 1 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 11 |
2 files changed, 10 insertions, 2 deletions
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index c558c0803b..da78a057b5 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -265,7 +265,6 @@ public: // Follow parent chain to the top. bool getObjectTopmostAncestor(const LLUUID& object_id, LLUUID& result) const; -private: U32 getDescendentsCountRecursive(const LLUUID& id, U32 max_item_limit); //-------------------------------------------------------------------- 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<LLFolderViewItem*> 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<LLFolderViewItem*>::const_iterator it = inventory_selected.begin(), end_it = inventory_selected.end(); + it != end_it; + ++it) + { + LLUUID item_id = static_cast<LLFolderViewModelItemInventory*>((*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)); } |