summaryrefslogtreecommitdiff
path: root/indra/newview/llavataractions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llavataractions.cpp')
-rw-r--r--indra/newview/llavataractions.cpp11
1 files changed, 9 insertions, 2 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<LLFolderViewItem*> 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<LLFolderViewItem*>::const_iterator it = inventory_selected.begin();
const std::set<LLFolderViewItem*>::const_iterator it_end = inventory_selected.end();
for (; it != it_end; ++it)
{
- LLViewerInventoryCategory* inv_cat = gInventory.getCategory(static_cast<LLFolderViewModelItemInventory*>((*it)->getViewModelItem())->getUUID());
- // any category can be offered.
+ LLUUID cat_id = static_cast<LLFolderViewModelItemInventory*>((*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;
}