diff options
author | Rider Linden <rider@lindenlab.com> | 2015-08-12 16:32:49 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2015-08-12 16:32:49 -0700 |
commit | 248d61fe0eadd128c7704e37922ba7fdef35d630 (patch) | |
tree | 47597f9a1d4a1a3dc774c9f10f3d6d74338c5322 /indra/newview/llviewerinventory.cpp | |
parent | 14a8c70867252926fdfc42728c1de38c8ef68706 (diff) |
MAINT-5500: Finish converting the AIS responders to the new coroutine model, Cleaned up dead an unused code.
MAINT-4952: Added COPY and MOVE methods to Core:Http adapter
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rwxr-xr-x | indra/newview/llviewerinventory.cpp | 84 |
1 files changed, 21 insertions, 63 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 729af3c8ed..ac19d84a5e 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -80,6 +80,7 @@ static const char * const LOG_LOCAL("InventoryLocalize"); static const char * const LOG_NOTECARD("copy_inventory_from_notecard"); #if 1 +// *TODO$: LLInventoryCallback should be deprecated to conform to the new boost::bind/coroutine model. // temp code in transition void doInventoryCb(LLPointer<LLInventoryCallback> cb, LLUUID id) { @@ -1289,21 +1290,14 @@ void link_inventory_array(const LLUUID& category, #endif } - bool ais_ran = false; - if (AISCommand::isAPIAvailable()) + if (AISAPI::isAvailable()) { LLSD new_inventory = LLSD::emptyMap(); new_inventory["links"] = links; -#if 1 AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1); - AISAPI::CreateInventoryCommand(category, new_inventory, cr); -#else - LLPointer<AISCommand> cmd_ptr = new CreateInventoryCommand(category, new_inventory, cb); - ais_ran = cmd_ptr->run_command(); -#endif + AISAPI::CreateInventory(category, new_inventory, cr); } - - if (!ais_ran) + else { LLMessageSystem* msg = gMessageSystem; for (LLSD::array_iterator iter = links.beginArray(); iter != links.endArray(); ++iter ) @@ -1360,8 +1354,7 @@ void update_inventory_item( LLPointer<LLInventoryCallback> cb) { const LLUUID& item_id = update_item->getUUID(); - bool ais_ran = false; - if (AISCommand::isAPIAvailable()) + if (AISAPI::isAvailable()) { LLSD updates = update_item->asLLSD(); // Replace asset_id and/or shadow_id with transaction_id (hash_id) @@ -1375,15 +1368,10 @@ void update_inventory_item( updates.erase("shadow_id"); updates["hash_id"] = update_item->getTransactionID(); } -#if 1 AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1); - AISAPI::UpdateItemCommand(item_id, updates, cr); -#else - LLPointer<AISCommand> cmd_ptr = new UpdateItemCommand(item_id, updates, cb); - ais_ran = cmd_ptr->run_command(); -#endif + AISAPI::UpdateItem(item_id, updates, cr); } - if (!ais_ran) + else { LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id); LL_DEBUGS(LOG_INV) << "item_id: [" << item_id << "] name " << (update_item ? update_item->getName() : "(NOT FOUND)") << LL_ENDL; @@ -1419,18 +1407,12 @@ void update_inventory_item( const LLSD& updates, LLPointer<LLInventoryCallback> cb) { - bool ais_ran = false; - if (AISCommand::isAPIAvailable()) + if (AISAPI::isAvailable()) { -#if 1 AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1); - AISAPI::UpdateItemCommand(item_id, updates, cr); -#else - LLPointer<AISCommand> cmd_ptr = new UpdateItemCommand(item_id, updates, cb); - ais_ran = cmd_ptr->run_command(); -#endif + AISAPI::UpdateItem(item_id, updates, cr); } - if (!ais_ran) + else { LLPointer<LLViewerInventoryItem> obj = gInventory.getItem(item_id); LL_DEBUGS(LOG_INV) << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << LL_ENDL; @@ -1480,16 +1462,11 @@ void update_inventory_category( LLPointer<LLViewerInventoryCategory> new_cat = new LLViewerInventoryCategory(obj); new_cat->fromLLSD(updates); // FIXME - restore this once the back-end work has been done. - if (AISCommand::isAPIAvailable()) + if (AISAPI::isAvailable()) { LLSD new_llsd = new_cat->asLLSD(); -#if 1 AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1); - AISAPI::UpdateCategoryCommand(cat_id, new_llsd, cr); -#else - LLPointer<AISCommand> cmd_ptr = new UpdateCategoryCommand(cat_id, new_llsd, cb); - cmd_ptr->run_command(); -#endif + AISAPI::UpdateCategory(cat_id, new_llsd, cr); } else // no cap { @@ -1551,15 +1528,10 @@ void remove_inventory_item( { const LLUUID item_id(obj->getUUID()); LL_DEBUGS(LOG_INV) << "item_id: [" << item_id << "] name " << obj->getName() << LL_ENDL; - if (AISCommand::isAPIAvailable()) + if (AISAPI::isAvailable()) { -#if 1 AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1); - AISAPI::RemoveItemCommand(item_id, cr); -#else - LLPointer<AISCommand> cmd_ptr = new RemoveItemCommand(item_id, cb); - cmd_ptr->run_command(); -#endif + AISAPI::RemoveItem(item_id, cr); if (immediate_delete) { @@ -1632,15 +1604,10 @@ void remove_inventory_category( LLNotificationsUtil::add("CannotRemoveProtectedCategories"); return; } - if (AISCommand::isAPIAvailable()) + if (AISAPI::isAvailable()) { -#if 1 AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1); - AISAPI::RemoveCategoryCommand(cat_id, cr); -#else - LLPointer<AISCommand> cmd_ptr = new RemoveCategoryCommand(cat_id, cb); - cmd_ptr->run_command(); -#endif + AISAPI::RemoveCategory(cat_id, cr); } else // no cap { @@ -1740,15 +1707,10 @@ void purge_descendents_of(const LLUUID& id, LLPointer<LLInventoryCallback> cb) } else { - if (AISCommand::isAPIAvailable()) + if (AISAPI::isAvailable()) { -#if 1 AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1); - AISAPI::PurgeDescendentsCommand(id, cr); -#else - LLPointer<AISCommand> cmd_ptr = new PurgeDescendentsCommand(id, cb); - cmd_ptr->run_command(); -#endif + AISAPI::PurgeDescendents(id, cr); } else // no cap { @@ -1895,17 +1857,13 @@ void slam_inventory_folder(const LLUUID& folder_id, const LLSD& contents, LLPointer<LLInventoryCallback> cb) { - if (AISCommand::isAPIAvailable()) + if (AISAPI::isAvailable()) { LL_DEBUGS(LOG_INV) << "using AISv3 to slam folder, id " << folder_id << " new contents: " << ll_pretty_print_sd(contents) << LL_ENDL; -#if 1 + AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1); - AISAPI::SlamFolderCommand(folder_id, contents, cr); -#else - LLPointer<AISCommand> cmd_ptr = new SlamFolderCommand(folder_id, contents, cb); - cmd_ptr->run_command(); -#endif + AISAPI::SlamFolder(folder_id, contents, cr); } else // no cap { |