diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llinventoryfunctions.cpp | 10 | ||||
-rw-r--r-- | indra/newview/lloutfitslist.cpp | 23 | ||||
-rw-r--r-- | indra/newview/lloutfitslist.h | 5 | ||||
-rw-r--r-- | indra/newview/llwearableitemslist.cpp | 13 |
4 files changed, 16 insertions, 35 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index f20acbd016..2517db2678 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -251,6 +251,16 @@ BOOL get_can_item_be_worn(const LLUUID& id) if (!item) return FALSE; + const LLUUID trash_id = gInventory.findCategoryUUIDForType( + LLFolderType::FT_TRASH); + + // item can't be worn if base obj in trash, see EXT-7015 + if (gInventory.isObjectDescendentOf(item->getLinkedUUID(), + trash_id)) + { + return false; + } + switch(item->getType()) { case LLAssetType::AT_OBJECT: diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 1ed7ca22f5..c3eee1d1ad 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -723,29 +723,6 @@ void LLOutfitsList::getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const } } -bool LLOutfitsList::isSelectedInTrash() -{ - bool res = false; - const LLUUID trash_id = gInventory.findCategoryUUIDForType( - LLFolderType::FT_TRASH); - - uuid_vec_t selected_uuids; - getSelectedItemsUUIDs(selected_uuids); - - for (uuid_vec_t::const_iterator it = selected_uuids.begin(); it != selected_uuids.end(); it++) - { - const LLInventoryItem* item = gInventory.getItem(*it); - if (item != NULL && gInventory.isObjectDescendentOf( - item->getLinkedUUID(), trash_id)) - { - res = true; - break; - } - } - - return res; -} - boost::signals2::connection LLOutfitsList::setSelectionChangeCallback(selection_change_callback_t cb) { return mSelectionChangeSignal.connect(cb); diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index af094c28d4..206854b232 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -105,11 +105,6 @@ public: void getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const; - /** - * Returns true in case any of selected item is in trash. - */ - bool isSelectedInTrash(); - boost::signals2::connection setSelectionChangeCallback(selection_change_callback_t cb); // Collects selected items from all selected lists and wears them(if possible- adds, else replaces) diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 98ebd68564..8035cd2d93 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -769,8 +769,7 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu U32 n_links = 0; // number of links among the selected items U32 n_editable = 0; // number of editable items among the selected ones - bool item_in_trash = false; - const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); + bool can_be_worn = false; for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) { @@ -809,20 +808,20 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu } // if any in trash - if (!item_in_trash) + if (!can_be_worn) { - item_in_trash = gInventory.isObjectDescendentOf(item->getLinkedUUID(), trash_id); + can_be_worn = get_can_item_be_worn(item->getLinkedUUID()); } } // for bool standalone = mParent ? mParent->isStandalone() : false; // *TODO: eliminate multiple traversals over the menu items - setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0 && !item_in_trash); + setMenuItemVisible(menu, "wear_wear", n_already_worn == 0 && n_worn == 0 && can_be_worn); setMenuItemEnabled(menu, "wear_wear", n_already_worn == 0 && n_worn == 0); - setMenuItemVisible(menu, "wear_add", mask == MASK_CLOTHING && n_worn == 0 && n_already_worn != 0 && !item_in_trash); + setMenuItemVisible(menu, "wear_add", mask == MASK_CLOTHING && n_worn == 0 && n_already_worn != 0 && can_be_worn); setMenuItemEnabled(menu, "wear_add", n_items == 1 && canAddWearable(ids.front()) && n_already_worn != 0); - setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0 && !item_in_trash); + setMenuItemVisible(menu, "wear_replace", n_worn == 0 && n_already_worn != 0 && can_be_worn); //visible only when one item selected and this item is worn setMenuItemVisible(menu, "edit", !standalone && mask & (MASK_CLOTHING|MASK_BODYPART) && n_worn == n_items && n_worn == 1); setMenuItemEnabled(menu, "edit", n_editable == 1 && n_worn == 1 && n_items == 1); |