diff options
| author | Ruslan Teliuk <ruslantproductengine@lindenlab.com> | 2016-09-27 15:43:53 +0300 |
|---|---|---|
| committer | Ruslan Teliuk <ruslantproductengine@lindenlab.com> | 2016-09-27 15:43:53 +0300 |
| commit | 999dc6c61ba48c5bd930e63bfc6dc7d1e494b43c (patch) | |
| tree | 5c0f00f9521aa0298ff2813d5116cf4b12a04597 /indra/newview/llavataractions.cpp | |
| parent | 25c20f98a88a457b5fa865e8dc302b24378bc842 (diff) | |
| parent | fa4376b457b887130e98bd96e6bccb231e8947d2 (diff) | |
Merged lindenlab/viewer-neko into default
Diffstat (limited to 'indra/newview/llavataractions.cpp')
| -rw-r--r-- | indra/newview/llavataractions.cpp | 11 |
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; } |
