aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llinventorymodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llinventorymodel.cpp')
-rw-r--r--linden/indra/newview/llinventorymodel.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/linden/indra/newview/llinventorymodel.cpp b/linden/indra/newview/llinventorymodel.cpp
index 3f74965..8b98782 100644
--- a/linden/indra/newview/llinventorymodel.cpp
+++ b/linden/indra/newview/llinventorymodel.cpp
@@ -455,8 +455,6 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id,
455 void (*callback)(const LLSD&, void*), 455 void (*callback)(const LLSD&, void*),
456 void* user_data) 456 void* user_data)
457{ 457{
458 llassert_always(NULL != callback);
459
460 LLUUID id; 458 LLUUID id;
461 459
462 if(!isInventoryUsable()) 460 if(!isInventoryUsable())
@@ -464,7 +462,8 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id,
464 llwarns << "Inventory is broken." << llendl; 462 llwarns << "Inventory is broken." << llendl;
465 LLSD result; 463 LLSD result;
466 result["failure"] = true; 464 result["failure"] = true;
467 callback(result, user_data); 465 if (callback)
466 callback(result, user_data);
468 } 467 }
469 468
470 469
@@ -473,7 +472,8 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id,
473 LL_DEBUGS("Inventory") << "Attempt to create simstate category." << LL_ENDL; 472 LL_DEBUGS("Inventory") << "Attempt to create simstate category." << LL_ENDL;
474 LLSD result; 473 LLSD result;
475 result["failure"] = true; 474 result["failure"] = true;
476 callback(result, user_data); 475 if (callback)
476 callback(result, user_data);
477 } 477 }
478 478
479 id.generate(); 479 id.generate();
@@ -492,10 +492,8 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id,
492 name.assign(NEW_CATEGORY_NAME); 492 name.assign(NEW_CATEGORY_NAME);
493 } 493 }
494 494
495 if (user_data) // callback required for acked message. 495 if ((NULL != callback) && (NULL != user_data)) // callback required for acked message.
496 { 496 {
497
498
499 LLViewerRegion* viewer_region = gAgent.getRegion(); 497 LLViewerRegion* viewer_region = gAgent.getRegion();
500 498
501 if (!viewer_region->capabilitiesReceived()) 499 if (!viewer_region->capabilitiesReceived())
@@ -537,7 +535,10 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id,
537 { 535 {
538 // user_data is a LLCategoryCreate object instantiated in the calling 536 // user_data is a LLCategoryCreate object instantiated in the calling
539 // function - bug (or low memory - any leaks?). 537 // function - bug (or low memory - any leaks?).
540 llwarns << "NULL user_data" << llendl; 538 // Or, it might just be no problem, since passing the callback in the first place is optional.
539 // It's really up to the calling function to know what it passed to pass back to the callback.
540 if (callback)
541 llwarns << "NULL user_data" << llendl;
541 } 542 }
542 543
543 // Add the category to the internal representation 544 // Add the category to the internal representation
@@ -1211,7 +1212,6 @@ void LLInventoryModel::fetchInventoryResponder::result(const LLSD& content)
1211 item_array_t items; 1212 item_array_t items;
1212 update_map_t update; 1213 update_map_t update;
1213 S32 count = content["items"].size(); 1214 S32 count = content["items"].size();
1214 bool all_one_folder = true;
1215 LLUUID folder_id; 1215 LLUUID folder_id;
1216 // Does this loop ever execute more than once? 1216 // Does this loop ever execute more than once?
1217 for(S32 i = 0; i < count; ++i) 1217 for(S32 i = 0; i < count; ++i)
@@ -1244,10 +1244,6 @@ void LLInventoryModel::fetchInventoryResponder::result(const LLSD& content)
1244 { 1244 {
1245 folder_id = titem->getParentUUID(); 1245 folder_id = titem->getParentUUID();
1246 } 1246 }
1247 else
1248 {
1249 all_one_folder = false;
1250 }
1251 } 1247 }
1252 1248
1253 U32 changes = 0x0; 1249 U32 changes = 0x0;
@@ -2960,7 +2956,6 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account)
2960 item_array_t items; 2956 item_array_t items;
2961 update_map_t update; 2957 update_map_t update;
2962 S32 count = msg->getNumberOfBlocksFast(_PREHASH_InventoryData); 2958 S32 count = msg->getNumberOfBlocksFast(_PREHASH_InventoryData);
2963 bool all_one_folder = true;
2964 LLUUID folder_id; 2959 LLUUID folder_id;
2965 // Does this loop ever execute more than once? 2960 // Does this loop ever execute more than once?
2966 for(S32 i = 0; i < count; ++i) 2961 for(S32 i = 0; i < count; ++i)
@@ -2992,10 +2987,6 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account)
2992 { 2987 {
2993 folder_id = titem->getParentUUID(); 2988 folder_id = titem->getParentUUID();
2994 } 2989 }
2995 else
2996 {
2997 all_one_folder = false;
2998 }
2999 } 2990 }
3000 if(account) 2991 if(account)
3001 { 2992 {