diff options
Diffstat (limited to 'indra/newview/lltooldraganddrop.cpp')
-rwxr-xr-x | indra/newview/lltooldraganddrop.cpp | 201 |
1 files changed, 94 insertions, 107 deletions
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 1a137f7129..eabf6f0497 100755 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -175,7 +175,7 @@ public: virtual void done() { /* no-op: it's fire n forget right? */ - lldebugs << "LLCategoryFireAndForget::done()" << llendl; + LL_DEBUGS() << "LLCategoryFireAndForget::done()" << LL_ENDL; } }; @@ -256,7 +256,7 @@ void LLCategoryDropDescendentsObserver::done() LLInventoryModel::EXCLUDE_TRASH); } - S32 count = items.count(); + S32 count = items.size(); if (count) { std::set<LLUUID> unique_ids; @@ -371,7 +371,7 @@ void LLToolDragAndDrop::beginDrag(EDragAndDropType type, { if (type == DAD_NONE) { - llwarns << "Attempted to start drag without a cargo type" << llendl; + LL_WARNS() << "Attempted to start drag without a cargo type" << LL_ENDL; return; } mCargoTypes.clear(); @@ -408,16 +408,16 @@ void LLToolDragAndDrop::beginDrag(EDragAndDropType type, items, LLInventoryModel::EXCLUDE_TRASH, is_not_preferred); - S32 count = cats.count(); + S32 count = cats.size(); S32 i; for(i = 0; i < count; ++i) { - folder_ids.push_back(cats.get(i)->getUUID()); + folder_ids.push_back(cats.at(i)->getUUID()); } - count = items.count(); + count = items.size(); for(i = 0; i < count; ++i) { - item_ids.push_back(items.get(i)->getUUID()); + item_ids.push_back(items.at(i)->getUUID()); } if (!folder_ids.empty() || !item_ids.empty()) { @@ -443,7 +443,7 @@ void LLToolDragAndDrop::beginMultiDrag( { if (DAD_NONE == *types_it) { - llwarns << "Attempted to start drag without a cargo type" << llendl; + LL_WARNS() << "Attempted to start drag without a cargo type" << LL_ENDL; return; } } @@ -479,7 +479,7 @@ void LLToolDragAndDrop::beginMultiDrag( items, LLInventoryModel::EXCLUDE_TRASH, is_not_preferred); - S32 cat_count = cats.count(); + S32 cat_count = cats.size(); for(S32 i = 0; i < cat_count; ++i) { cat_ids.insert(cat->getUUID()); @@ -598,7 +598,7 @@ BOOL LLToolDragAndDrop::handleHover( S32 x, S32 y, MASK mask ) ECursorType cursor = acceptanceToCursor(acceptance); gViewerWindow->getWindow()->setCursor( cursor ); - lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolDragAndDrop" << llendl; + LL_DEBUGS("UserInput") << "hover handled by LLToolDragAndDrop" << LL_ENDL; return TRUE; } @@ -1035,7 +1035,7 @@ BOOL LLToolDragAndDrop::handleDropTextureProtections(LLViewerObject* hit_obj, } else { - llwarns << "Unable to find source object." << llendl; + LL_WARNS() << "Unable to find source object." << LL_ENDL; return FALSE; } } @@ -1085,7 +1085,7 @@ void LLToolDragAndDrop::dropTextureAllFaces(LLViewerObject* hit_obj, { if (!item) { - llwarns << "LLToolDragAndDrop::dropTextureAllFaces no texture item." << llendl; + LL_WARNS() << "LLToolDragAndDrop::dropTextureAllFaces no texture item." << LL_ENDL; return; } LLUUID asset_id = item->getAssetUUID(); @@ -1095,7 +1095,7 @@ void LLToolDragAndDrop::dropTextureAllFaces(LLViewerObject* hit_obj, return; } LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture(asset_id); - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT ); + add(LLStatViewer::EDIT_TEXTURE, 1); S32 num_faces = hit_obj->getNumTEs(); for( S32 face = 0; face < num_faces; face++ ) { @@ -1115,7 +1115,7 @@ void LLToolDragAndDrop::dropMesh(LLViewerObject* hit_obj, { if (!item) { - llwarns << "no inventory item." << llendl; + LL_WARNS() << "no inventory item." << LL_ENDL; return; } LLUUID asset_id = item->getAssetUUID(); @@ -1152,7 +1152,7 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj, if (hit_face == -1) return; if (!item) { - llwarns << "LLToolDragAndDrop::dropTextureOneFace no texture item." << llendl; + LL_WARNS() << "LLToolDragAndDrop::dropTextureOneFace no texture item." << LL_ENDL; return; } LLUUID asset_id = item->getAssetUUID(); @@ -1163,7 +1163,7 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj, } // update viewer side image in anticipation of update from simulator LLViewerTexture* image = LLViewerTextureManager::getFetchedTexture(asset_id); - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT ); + add(LLStatViewer::EDIT_TEXTURE, 1); LLTextureEntry* tep = hit_obj ? (hit_obj->getTE(hit_face)) : NULL; @@ -1227,8 +1227,8 @@ void LLToolDragAndDrop::dropScript(LLViewerObject* hit_obj, if ((SOURCE_WORLD == LLToolDragAndDrop::getInstance()->mSource) || (SOURCE_NOTECARD == LLToolDragAndDrop::getInstance()->mSource)) { - llwarns << "Call to LLToolDragAndDrop::dropScript() from world" - << " or notecard." << llendl; + LL_WARNS() << "Call to LLToolDragAndDrop::dropScript() from world" + << " or notecard." << LL_ENDL; return; } if (hit_obj && item) @@ -1255,7 +1255,7 @@ void LLToolDragAndDrop::dropScript(LLViewerObject* hit_obj, } else { - llwarns << "Unable to find source object." << llendl; + LL_WARNS() << "Unable to find source object." << LL_ENDL; return; } } @@ -1280,11 +1280,11 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target, LLViewerRegion* regionp = LLWorld::getInstance()->getRegionFromPosGlobal(mLastHitPos); if (!regionp) { - llwarns << "Couldn't find region to rez object" << llendl; + LL_WARNS() << "Couldn't find region to rez object" << LL_ENDL; return; } - //llinfos << "Rezzing object" << llendl; + //LL_INFOS() << "Rezzing object" << LL_ENDL; make_ui_sound("UISndObjectRezIn"); LLViewerInventoryItem* item; LLViewerInventoryCategory* cat; @@ -1431,7 +1431,7 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target, effectp->setDuration(LL_HUD_DUR_SHORT); effectp->setColor(LLColor4U(gAgent.getEffectColor())); - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_REZ_COUNT); + add(LLStatViewer::OBJECT_REZ, 1); } void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj, @@ -1444,8 +1444,8 @@ void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj, if ((SOURCE_WORLD == LLToolDragAndDrop::getInstance()->mSource) || (SOURCE_NOTECARD == LLToolDragAndDrop::getInstance()->mSource)) { - llwarns << "Call to LLToolDragAndDrop::dropInventory() from world" - << " or notecard." << llendl; + LL_WARNS() << "Call to LLToolDragAndDrop::dropInventory() from world" + << " or notecard." << LL_ENDL; return; } @@ -1475,7 +1475,7 @@ void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj, } else { - llwarns << "Unable to find source object." << llendl; + LL_WARNS() << "Unable to find source object." << LL_ENDL; return; } } @@ -1584,13 +1584,22 @@ static void give_inventory_cb(const LLSD& notification, const LLSD& response) const LLUUID& session_id = payload["session_id"]; const LLUUID& agent_id = payload["agent_id"]; LLViewerInventoryItem * inv_item = gInventory.getItem(payload["item_id"]); - if (NULL == inv_item) + LLViewerInventoryCategory * inv_cat = gInventory.getCategory(payload["item_id"]); + if (NULL == inv_item && NULL == inv_cat) { - llassert(NULL != inv_item); + llassert( FALSE ); return; } - - if (LLGiveInventory::doGiveInventoryItem(agent_id, inv_item, session_id)) + bool successfully_shared; + if (inv_item) + { + successfully_shared = LLGiveInventory::doGiveInventoryItem(agent_id, inv_item, session_id); + } + else + { + successfully_shared = LLGiveInventory::doGiveInventoryCategory(agent_id, inv_cat, session_id); + } + if (successfully_shared) { if ("avatarpicker" == payload["d&d_dest"].asString()) { @@ -1600,8 +1609,8 @@ static void give_inventory_cb(const LLSD& notification, const LLSD& response) } } -static void show_item_sharing_confirmation(const std::string name, - LLViewerInventoryItem* inv_item, +static void show_object_sharing_confirmation(const std::string name, + LLInventoryObject* inv_item, const LLSD& dest, const LLUUID& dest_agent, const LLUUID& session_id = LLUUID::null) @@ -1611,7 +1620,6 @@ static void show_item_sharing_confirmation(const std::string name, llassert(NULL != inv_item); return; } - LLSD substitutions; substitutions["RESIDENTS"] = name; substitutions["ITEMS"] = inv_item->getName(); @@ -1625,15 +1633,15 @@ static void show_item_sharing_confirmation(const std::string name, static void get_name_cb(const LLUUID& id, const std::string& full_name, - LLViewerInventoryItem* inv_item, + LLInventoryObject* inv_obj, const LLSD& dest, const LLUUID& dest_agent) { - show_item_sharing_confirmation(full_name, - inv_item, - dest, - id, - LLUUID::null); + show_object_sharing_confirmation(full_name, + inv_obj, + dest, + id, + LLUUID::null); } // function used as drag-and-drop handler for simple agent give inventory requests @@ -1659,10 +1667,11 @@ bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_ case DAD_GESTURE: case DAD_CALLINGCARD: case DAD_MESH: + case DAD_CATEGORY: { - LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data; - if(gInventory.getItem(inv_item->getUUID()) - && LLGiveInventory::isInventoryGiveAcceptable(inv_item)) + LLInventoryObject* inv_obj = (LLInventoryObject*)cargo_data; + if(gInventory.getCategory(inv_obj->getUUID()) || (gInventory.getItem(inv_obj->getUUID()) + && LLGiveInventory::isInventoryGiveAcceptable(dynamic_cast<LLInventoryItem*>(inv_obj)))) { // *TODO: get multiple object transfers working *accept = ACCEPT_YES_COPY_SINGLE; @@ -1679,40 +1688,18 @@ bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_ // Otherwise set up a callback to show the dialog when the name arrives. if (gCacheName->getFullName(dest_agent, fullname)) { - show_item_sharing_confirmation(fullname, inv_item, dest, dest_agent, LLUUID::null); + show_object_sharing_confirmation(fullname, inv_obj, dest, dest_agent, LLUUID::null); } else { - gCacheName->get(dest_agent, false, boost::bind(&get_name_cb, _1, _2, inv_item, dest, dest_agent)); + gCacheName->get(dest_agent, false, boost::bind(&get_name_cb, _1, _2, inv_obj, dest, dest_agent)); } return true; } // If an IM session with destination agent is found item offer will be logged in this session. - show_item_sharing_confirmation(session->mName, inv_item, dest, dest_agent, session_id); - } - } - else - { - // It's not in the user's inventory (it's probably - // in an object's contents), so disallow dragging - // it here. You can't give something you don't - // yet have. - *accept = ACCEPT_NO; - } - break; - } - case DAD_CATEGORY: - { - LLViewerInventoryCategory* inv_cat = (LLViewerInventoryCategory*)cargo_data; - if( gInventory.getCategory( inv_cat->getUUID() ) ) - { - // *TODO: get multiple object transfers working - *accept = ACCEPT_YES_COPY_SINGLE; - if(drop) - { - LLGiveInventory::doGiveInventoryCategory(dest_agent, inv_cat, session_id); + show_object_sharing_confirmation(session->mName, inv_obj, dest, dest_agent, session_id); } } else @@ -1742,14 +1729,14 @@ bool LLToolDragAndDrop::handleGiveDragAndDrop(LLUUID dest_agent, LLUUID session_ EAcceptance LLToolDragAndDrop::dad3dNULL( LLViewerObject*, S32, MASK, BOOL) { - lldebugs << "LLToolDragAndDrop::dad3dNULL()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dad3dNULL()" << LL_ENDL; return ACCEPT_NO; } EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { - lldebugs << "LLToolDragAndDrop::dad3dRezAttachmentFromInv()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dad3dRezAttachmentFromInv()" << LL_ENDL; // must be in the user's inventory if(mSource != SOURCE_AGENT && mSource != SOURCE_LIBRARY) { @@ -1812,7 +1799,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezObjectOnLand( return dad3dRezFromObjectOnLand(obj, face, mask, drop); } - lldebugs << "LLToolDragAndDrop::dad3dRezObjectOnLand()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dad3dRezObjectOnLand()" << LL_ENDL; LLViewerInventoryItem* item; LLViewerInventoryCategory* cat; locateInventory(item, cat); @@ -1875,7 +1862,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezObjectOnObject( return dad3dRezFromObjectOnObject(obj, face, mask, drop); } - lldebugs << "LLToolDragAndDrop::dad3dRezObjectOnObject()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dad3dRezObjectOnObject()" << LL_ENDL; LLViewerInventoryItem* item; LLViewerInventoryCategory* cat; locateInventory(item, cat); @@ -1947,7 +1934,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezObjectOnObject( EAcceptance LLToolDragAndDrop::dad3dRezScript( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { - lldebugs << "LLToolDragAndDrop::dad3dRezScript()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dad3dRezScript()" << LL_ENDL; // *HACK: In order to resolve SL-22177, we need to block drags // from notecards and objects onto other objects. @@ -1985,7 +1972,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezScript( EAcceptance LLToolDragAndDrop::dad3dApplyToObject( LLViewerObject* obj, S32 face, MASK mask, BOOL drop, EDragAndDropType cargo_type) { - lldebugs << "LLToolDragAndDrop::dad3dApplyToObject()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dad3dApplyToObject()" << LL_ENDL; // *HACK: In order to resolve SL-22177, we need to block drags // from notecards and objects onto other objects. @@ -2036,7 +2023,7 @@ EAcceptance LLToolDragAndDrop::dad3dApplyToObject( } else { - llwarns << "unsupported asset type" << llendl; + LL_WARNS() << "unsupported asset type" << LL_ENDL; } // VEFFECT: SetTexture @@ -2069,7 +2056,7 @@ EAcceptance LLToolDragAndDrop::dad3dMeshObject( EAcceptance LLToolDragAndDrop::dad3dTextureSelf( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { - lldebugs << "LLToolDragAndDrop::dad3dTextureAvatar()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dad3dTextureAvatar()" << LL_ENDL; if(drop) { if( !(mask & MASK_SHIFT) ) @@ -2084,7 +2071,7 @@ EAcceptance LLToolDragAndDrop::dad3dTextureSelf( EAcceptance LLToolDragAndDrop::dad3dWearItem( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { - lldebugs << "LLToolDragAndDrop::dad3dWearItem()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dad3dWearItem()" << LL_ENDL; LLViewerInventoryItem* item; LLViewerInventoryCategory* cat; locateInventory(item, cat); @@ -2117,7 +2104,7 @@ EAcceptance LLToolDragAndDrop::dad3dWearItem( EAcceptance LLToolDragAndDrop::dad3dActivateGesture( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { - lldebugs << "LLToolDragAndDrop::dad3dActivateGesture()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dad3dActivateGesture()" << LL_ENDL; LLViewerInventoryItem* item; LLViewerInventoryCategory* cat; locateInventory(item, cat); @@ -2166,7 +2153,7 @@ EAcceptance LLToolDragAndDrop::dad3dActivateGesture( EAcceptance LLToolDragAndDrop::dad3dWearCategory( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { - lldebugs << "LLToolDragAndDrop::dad3dWearCategory()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dad3dWearCategory()" << LL_ENDL; LLViewerInventoryItem* item; LLViewerInventoryCategory* category; locateInventory(item, category); @@ -2217,7 +2204,7 @@ EAcceptance LLToolDragAndDrop::dad3dWearCategory( EAcceptance LLToolDragAndDrop::dad3dUpdateInventory( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { - lldebugs << "LLToolDragAndDrop::dadUpdateInventory()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dadUpdateInventory()" << LL_ENDL; // *HACK: In order to resolve SL-22177, we need to block drags // from notecards and objects onto other objects. @@ -2257,10 +2244,10 @@ BOOL LLToolDragAndDrop::dadUpdateInventory(LLViewerObject* obj, BOOL drop) EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { - lldebugs << "LLToolDragAndDrop::dad3dUpdateInventoryCategory()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dad3dUpdateInventoryCategory()" << LL_ENDL; if (obj == NULL) { - llwarns << "obj is NULL; aborting func with ACCEPT_NO" << llendl; + LL_WARNS() << "obj is NULL; aborting func with ACCEPT_NO" << LL_ENDL; return ACCEPT_NO; } @@ -2290,10 +2277,10 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory( items, LLInventoryModel::EXCLUDE_TRASH, droppable); - cats.put(cat); + cats.push_back(cat); if (droppable.countNoCopy() > 0) { - llwarns << "*** Need to confirm this step" << llendl; + LL_WARNS() << "*** Need to confirm this step" << LL_ENDL; } LLViewerObject* root_object = obj; if (obj->getParent()) @@ -2316,7 +2303,7 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory( rv = gInventory.isCategoryComplete(cat->getUUID()) ? ACCEPT_YES_MULTI : ACCEPT_NO; if(rv < ACCEPT_YES_SINGLE) { - lldebugs << "Category " << cat->getUUID() << "is not complete." << llendl; + LL_DEBUGS() << "Category " << cat->getUUID() << "is not complete." << LL_ENDL; break; } } @@ -2338,7 +2325,7 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory( rv = willObjectAcceptInventory(root_object, item); if (rv < ACCEPT_YES_COPY_SINGLE) { - lldebugs << "Object will not accept " << item->getUUID() << llendl; + LL_DEBUGS() << "Object will not accept " << item->getUUID() << LL_ENDL; break; } } @@ -2379,7 +2366,7 @@ BOOL LLToolDragAndDrop::dadUpdateInventoryCategory(LLViewerObject* obj, EAcceptance LLToolDragAndDrop::dad3dGiveInventoryObject( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { - lldebugs << "LLToolDragAndDrop::dad3dGiveInventoryObject()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dad3dGiveInventoryObject()" << LL_ENDL; // item has to be in agent inventory. if(mSource != SOURCE_AGENT) return ACCEPT_NO; @@ -2417,7 +2404,7 @@ EAcceptance LLToolDragAndDrop::dad3dGiveInventoryObject( EAcceptance LLToolDragAndDrop::dad3dGiveInventory( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { - lldebugs << "LLToolDragAndDrop::dad3dGiveInventory()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dad3dGiveInventory()" << LL_ENDL; // item has to be in agent inventory. if(mSource != SOURCE_AGENT) return ACCEPT_NO; LLViewerInventoryItem* item; @@ -2440,7 +2427,7 @@ EAcceptance LLToolDragAndDrop::dad3dGiveInventory( EAcceptance LLToolDragAndDrop::dad3dGiveInventoryCategory( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { - lldebugs << "LLToolDragAndDrop::dad3dGiveInventoryCategory()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dad3dGiveInventoryCategory()" << LL_ENDL; if(drop && obj) { LLViewerInventoryItem* item; @@ -2458,7 +2445,7 @@ EAcceptance LLToolDragAndDrop::dad3dGiveInventoryCategory( EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnLand( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { - lldebugs << "LLToolDragAndDrop::dad3dRezFromObjectOnLand()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dad3dRezFromObjectOnLand()" << LL_ENDL; LLViewerInventoryItem* item = NULL; LLViewerInventoryCategory* cat = NULL; locateInventory(item, cat); @@ -2479,7 +2466,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnLand( EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnObject( LLViewerObject* obj, S32 face, MASK mask, BOOL drop) { - lldebugs << "LLToolDragAndDrop::dad3dRezFromObjectOnObject()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dad3dRezFromObjectOnObject()" << LL_ENDL; LLViewerInventoryItem* item; LLViewerInventoryCategory* cat; locateInventory(item, cat); @@ -2516,7 +2503,7 @@ EAcceptance LLToolDragAndDrop::dad3dCategoryOnLand( { return ACCEPT_NO; /* - lldebugs << "LLToolDragAndDrop::dad3dCategoryOnLand()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dad3dCategoryOnLand()" << LL_ENDL; LLInventoryItem* item; LLInventoryCategory* cat; locateInventory(item, cat); @@ -2532,7 +2519,7 @@ EAcceptance LLToolDragAndDrop::dad3dCategoryOnLand( items, LLInventoryModel::EXCLUDE_TRASH, droppable); - if(items.count() > 0) + if(items.size() > 0) { rv = ACCEPT_YES_SINGLE; } @@ -2554,19 +2541,19 @@ EAcceptance LLToolDragAndDrop::dad3dAssetOnLand( { return ACCEPT_NO; /* - lldebugs << "LLToolDragAndDrop::dad3dAssetOnLand()" << llendl; + LL_DEBUGS() << "LLToolDragAndDrop::dad3dAssetOnLand()" << LL_ENDL; LLViewerInventoryCategory::cat_array_t cats; LLViewerInventoryItem::item_array_t items; LLViewerInventoryItem::item_array_t copyable_items; locateMultipleInventory(items, cats); - if(!items.count()) return ACCEPT_NO; + if(!items.size()) return ACCEPT_NO; EAcceptance rv = ACCEPT_NO; - for (S32 i = 0; i < items.count(); i++) + for (S32 i = 0; i < items.size(); i++) { LLInventoryItem* item = items[i]; if(item->getPermissions().allowCopyBy(gAgent.getID())) { - copyable_items.put(item); + copyable_items.push_back(item); rv = ACCEPT_YES_SINGLE; } } @@ -2638,21 +2625,21 @@ LLInventoryObject* LLToolDragAndDrop::locateInventory( LLInventoryObject* LLToolDragAndDrop::locateMultipleInventory(LLViewerInventoryCategory::cat_array_t& cats, LLViewerInventoryItem::item_array_t& items) { - if(mCargoIDs.count() == 0) return NULL; + if(mCargoIDs.size() == 0) return NULL; if((mSource == SOURCE_AGENT) || (mSource == SOURCE_LIBRARY)) { // The object should be in user inventory. - for (S32 i = 0; i < mCargoIDs.count(); i++) + for (S32 i = 0; i < mCargoIDs.size(); i++) { LLInventoryItem* item = gInventory.getItem(mCargoIDs[i]); if (item) { - items.put(item); + items.push_back(item); } LLInventoryCategory* category = gInventory.getCategory(mCargoIDs[i]); if (category) { - cats.put(category); + cats.push_back(category); } } } @@ -2666,23 +2653,23 @@ LLInventoryObject* LLToolDragAndDrop::locateMultipleInventory(LLViewerInventoryC || (mCargoType == DAD_ROOT_CATEGORY)) { // The object should be in user inventory. - for (S32 i = 0; i < mCargoIDs.count(); i++) + for (S32 i = 0; i < mCargoIDs.size(); i++) { LLInventoryCategory* category = (LLInventoryCategory*)obj->getInventoryObject(mCargoIDs[i]); if (category) { - cats.put(category); + cats.push_back(category); } } } else { - for (S32 i = 0; i < mCargoIDs.count(); i++) + for (S32 i = 0; i < mCargoIDs.size(); i++) { LLInventoryItem* item = (LLInventoryItem*)obj->getInventoryObject(mCargoIDs[i]); if (item) { - items.put(item); + items.push_back(item); } } } @@ -2694,18 +2681,18 @@ LLInventoryObject* LLToolDragAndDrop::locateMultipleInventory(LLViewerInventoryC card = (LLPreviewNotecard*)LLPreview::find(mSourceID); if(card) { - items.put((LLInventoryItem*)card->getDragItem()); + items.push_back((LLInventoryItem*)card->getDragItem()); } } - if(items.count()) return items[0]; - if(cats.count()) return cats[0]; + if(items.size()) return items[0]; + if(cats.size()) return cats[0]; return NULL; } */ // void LLToolDragAndDrop::createContainer(LLViewerInventoryItem::item_array_t &items, const char* preferred_name ) // { -// llwarns << "LLToolDragAndDrop::createContainer()" << llendl; +// LL_WARNS() << "LLToolDragAndDrop::createContainer()" << LL_ENDL; // return; // } |