diff options
| author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-12-10 14:47:17 -0500 |
|---|---|---|
| committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-12-10 14:47:17 -0500 |
| commit | 0777f53e2f2d773fa536b3c62e16455ce7bbbcce (patch) | |
| tree | 2050b2eb704687a839dfa42a0cd6b62c16e8cae8 /indra/newview/llviewerinventory.cpp | |
| parent | 542a9e0a410cc760f871082bf92cbea06c5a03ad (diff) | |
SH-3606 WIP - replaced several LLInventoryCallback subclasses with boost::func equivalents
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
| -rwxr-xr-x | indra/newview/llviewerinventory.cpp | 53 |
1 files changed, 9 insertions, 44 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index b47a41c44c..d6f0874a58 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -65,6 +65,10 @@ #include "llavataractions.h" #include "lllogininstance.h" +// Two do-nothing ops for use in callbacks. +void no_op_inventory_func(const LLUUID&) {} +void no_op() {} + ///---------------------------------------------------------------------------- /// Helper class to store special inventory item names and their localized values. ///---------------------------------------------------------------------------- @@ -949,46 +953,7 @@ void LLInventoryCallbackManager::fire(U32 callback_id, const LLUUID& item_id) } } -void WearOnAvatarCallback::fire(const LLUUID& inv_item) -{ - if (inv_item.isNull()) - return; - - LLViewerInventoryItem *item = gInventory.getItem(inv_item); - if (item) - { - LLAppearanceMgr::instance().wearItemOnAvatar(inv_item, true, mReplace); - } -} - -void ModifiedCOFCallback::fire(const LLUUID& inv_item) -{ - LLAppearanceMgr::instance().updateAppearanceFromCOF(); - - // Start editing the item if previously requested. - gAgentWearables.editWearableIfRequested(inv_item); - - // TODO: camera mode may not be changed if a debug setting is tweaked - if( gAgentCamera.cameraCustomizeAvatar() ) - { - // If we're in appearance editing mode, the current tab may need to be refreshed - LLSidepanelAppearance *panel = dynamic_cast<LLSidepanelAppearance*>(LLFloaterSidePanelContainer::getPanel("appearance")); - if (panel) - { - panel->showDefaultSubpart(); - } - } -} - -RezAttachmentCallback::RezAttachmentCallback(LLViewerJointAttachment *attachmentp) -{ - mAttach = attachmentp; -} -RezAttachmentCallback::~RezAttachmentCallback() -{ -} - -void RezAttachmentCallback::fire(const LLUUID& inv_item) +void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp) { if (inv_item.isNull()) return; @@ -996,11 +961,11 @@ void RezAttachmentCallback::fire(const LLUUID& inv_item) LLViewerInventoryItem *item = gInventory.getItem(inv_item); if (item) { - rez_attachment(item, mAttach); + rez_attachment(item, attachmentp); } } -void ActivateGestureCallback::fire(const LLUUID& inv_item) +void activate_gesture_cb(const LLUUID& inv_item) { if (inv_item.isNull()) return; @@ -1013,7 +978,7 @@ void ActivateGestureCallback::fire(const LLUUID& inv_item) LLGestureMgr::instance().activateGesture(inv_item); } -void CreateGestureCallback::fire(const LLUUID& inv_item) +void create_gesture_cb(const LLUUID& inv_item) { if (inv_item.isNull()) return; @@ -1288,7 +1253,7 @@ void create_new_item(const std::string& name, if (inv_type == LLInventoryType::IT_GESTURE) { - LLPointer<LLInventoryCallback> cb = new CreateGestureCallback(); + LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(create_gesture_cb); create_inventory_item(gAgent.getID(), gAgent.getSessionID(), parent_id, LLTransactionID::tnull, name, desc, asset_type, inv_type, NOT_WEARABLE, next_owner_perm, cb); |
