From db230ec3ac9761600e83322fb890342de3e38981 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 29 Aug 2016 11:15:54 +0300 Subject: MAINT-1768 Previous changes are reverted. Sharing items from trash is disabled now. --- indra/newview/llavataractions.cpp | 11 +++++++++-- indra/newview/llgiveinventory.cpp | 4 ++-- indra/newview/llinventorybridge.cpp | 6 ++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index a6e745448a..7b8c630837 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -950,15 +950,22 @@ bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = NUL const std::set inventory_selected = root_folder->getSelectionList(); if (inventory_selected.empty()) return false; // nothing selected + const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); bool can_share = true; std::set::const_iterator it = inventory_selected.begin(); const std::set::const_iterator it_end = inventory_selected.end(); for (; it != it_end; ++it) { - LLViewerInventoryCategory* inv_cat = gInventory.getCategory(static_cast((*it)->getViewModelItem())->getUUID()); - // any category can be offered. + LLUUID cat_id = static_cast((*it)->getViewModelItem())->getUUID(); + LLViewerInventoryCategory* inv_cat = gInventory.getCategory(cat_id); + // any category can be offered if it's not in trash. if (inv_cat) { + if ((cat_id == trash_id) || gInventory.isObjectDescendentOf(cat_id, trash_id)) + { + can_share = false; + break; + } continue; } diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index 97cc7684e4..a9bf8a9a50 100644 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -248,7 +248,7 @@ bool LLGiveInventory::doGiveInventoryCategory(const LLUUID& to_agent, gInventory.collectDescendentsIf (cat->getUUID(), cats, items, - LLInventoryModel::INCLUDE_TRASH, + LLInventoryModel::EXCLUDE_TRASH, giveable); S32 count = cats.size(); bool complete = true; @@ -499,7 +499,7 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent, gInventory.collectDescendentsIf (cat->getUUID(), cats, items, - LLInventoryModel::INCLUDE_TRASH, + LLInventoryModel::EXCLUDE_TRASH, giveable); bool give_successful = true; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 8d130c08e5..50fcf372a9 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1398,6 +1398,12 @@ bool LLInvFVBridge::canShare() const // Categories can be given. can_share = (model->getCategory(mUUID) != NULL); } + + const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); + if ((mUUID == trash_id) || gInventory.isObjectDescendentOf(mUUID, trash_id)) + { + can_share = false; + } } } -- cgit v1.2.3