From c01b4ee707a2870bf8dd1c00661695e0bfebf073 Mon Sep 17 00:00:00 2001 From: Tonya Souther Date: Tue, 26 Apr 2011 15:11:25 -0500 Subject: [PATCH] Allow double-click in inventory to remove wearable as well as wear it. From Satomi Ahn, fixes FIRE-303. --- indra/newview/llinventorybridge.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 22478d29c9..ac6577de0e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -5532,7 +5532,14 @@ class LLWearableBridgeAction: public LLInvFVBridgeAction public: virtual void doIt() { - wearOnAvatar(); + // TODO: investigate wearables may not be loaded at this point EXT-8231 + + LLViewerInventoryItem* item = getItem(); + if(item) + { + if ( get_is_item_worn(mUUID) ) LLAppearanceMgr::instance().removeItemFromAvatar(mUUID); + else LLAppearanceMgr::instance().wearItemOnAvatar(mUUID /*item->getUUID()*/, true, true); + } } virtual ~LLWearableBridgeAction(){} protected: @@ -5541,7 +5548,6 @@ protected: // return true if the item is in agent inventory. if false, it // must be lost or in the inventory library. BOOL isAgentInventory() const; - void wearOnAvatar(); }; BOOL LLWearableBridgeAction::isItemInTrash() const @@ -5558,17 +5564,6 @@ BOOL LLWearableBridgeAction::isAgentInventory() const return mModel->isObjectDescendentOf(mUUID, gInventory.getRootFolderID()); } -void LLWearableBridgeAction::wearOnAvatar() -{ - // TODO: investigate wearables may not be loaded at this point EXT-8231 - - LLViewerInventoryItem* item = getItem(); - if(item) - { - LLAppearanceMgr::instance().wearItemOnAvatar(item->getUUID(), true, true); - } -} - LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_type, const LLUUID& uuid, LLInventoryModel* model)