diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2017-05-08 18:05:10 +0300 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2017-05-08 18:05:10 +0300 |
commit | fb7be87bebd785a7a3e7a7b59103bc952d98dc83 (patch) | |
tree | cbb394f41cfdee600df60f03441b6f7361a92a43 /indra/newview/llinventorypanel.cpp | |
parent | d4d56f004a528ea0cada526132dd77bd410a8fe7 (diff) |
MAINT-7354 correction to misbehaving 'purge' and notification spam.
Diffstat (limited to 'indra/newview/llinventorypanel.cpp')
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 9de0633edb..a00dcf02ab 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -168,6 +168,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&LLInventoryPanel::beginIMSession, this)); mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars, this)); mCommitCallbackRegistrar.add("Inventory.FileUploadLocation", boost::bind(&LLInventoryPanel::fileUploadLocation, this, _2)); + mCommitCallbackRegistrar.add("Inventory.Purge", boost::bind(&LLInventoryPanel::purgeSelectedItems, this)); } LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id ) @@ -1211,6 +1212,21 @@ void LLInventoryPanel::fileUploadLocation(const LLSD& userdata) } } +void LLInventoryPanel::purgeSelectedItems() +{ + const std::set<LLFolderViewItem*> inventory_selected = mFolderRoot.get()->getSelectionList(); + if (inventory_selected.empty()) return; + + std::set<LLFolderViewItem*>::const_iterator it = inventory_selected.begin(); + const std::set<LLFolderViewItem*>::const_iterator it_end = inventory_selected.end(); + for (; it != it_end; ++it) + { + LLUUID item_id = static_cast<LLFolderViewModelItemInventory*>((*it)->getViewModelItem())->getUUID(); + remove_inventory_object(item_id, NULL); + } +} + + bool LLInventoryPanel::attachObject(const LLSD& userdata) { // Copy selected item UUIDs to a vector. |