diff options
Diffstat (limited to 'linden/indra/newview/llinventorymodel.cpp')
-rw-r--r-- | linden/indra/newview/llinventorymodel.cpp | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/linden/indra/newview/llinventorymodel.cpp b/linden/indra/newview/llinventorymodel.cpp index 0200ed0..dc216e3 100644 --- a/linden/indra/newview/llinventorymodel.cpp +++ b/linden/indra/newview/llinventorymodel.cpp | |||
@@ -60,6 +60,7 @@ | |||
60 | #include "llvoavatar.h" | 60 | #include "llvoavatar.h" |
61 | #include "llsdutil.h" | 61 | #include "llsdutil.h" |
62 | #include <deque> | 62 | #include <deque> |
63 | #include "llfloateropenobject.h" | ||
63 | 64 | ||
64 | // [RLVa:KB] | 65 | // [RLVa:KB] |
65 | #include "rlvhandler.h" | 66 | #include "rlvhandler.h" |
@@ -454,17 +455,25 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id, | |||
454 | void (*callback)(const LLSD&, void*), | 455 | void (*callback)(const LLSD&, void*), |
455 | void* user_data) | 456 | void* user_data) |
456 | { | 457 | { |
458 | llassert_always(NULL != callback); | ||
459 | |||
457 | LLUUID id; | 460 | LLUUID id; |
461 | |||
458 | if(!isInventoryUsable()) | 462 | if(!isInventoryUsable()) |
459 | { | 463 | { |
460 | llwarns << "Inventory is broken." << llendl; | 464 | llwarns << "Inventory is broken." << llendl; |
461 | return id; | 465 | LLSD result; |
462 | } | 466 | result["failure"] = true; |
467 | callback(result, user_data); | ||
468 | } | ||
469 | |||
463 | 470 | ||
464 | if(preferred_type == LLAssetType::AT_SIMSTATE) | 471 | if(preferred_type == LLAssetType::AT_SIMSTATE) |
465 | { | 472 | { |
466 | LL_DEBUGS("Inventory") << "Attempt to create simstate category." << LL_ENDL; | 473 | LL_DEBUGS("Inventory") << "Attempt to create simstate category." << LL_ENDL; |
467 | return id; | 474 | LLSD result; |
475 | result["failure"] = true; | ||
476 | callback(result, user_data); | ||
468 | } | 477 | } |
469 | 478 | ||
470 | id.generate(); | 479 | id.generate(); |
@@ -483,15 +492,17 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id, | |||
483 | name.assign(NEW_CATEGORY_NAME); | 492 | name.assign(NEW_CATEGORY_NAME); |
484 | } | 493 | } |
485 | 494 | ||
486 | if (callback && user_data) // callback required for acked message. | 495 | if (user_data) // callback required for acked message. |
487 | { | 496 | { |
488 | 497 | ||
489 | 498 | ||
490 | LLViewerRegion* viewer_region = gAgent.getRegion(); | 499 | LLViewerRegion* viewer_region = gAgent.getRegion(); |
491 | if (!viewer_region->capabilitiesReceived())//awfixme | 500 | |
501 | if (!viewer_region->capabilitiesReceived()) | ||
492 | { | 502 | { |
493 | LL_DEBUGS("Inventory") << "HIPPOS! not capabilitiesReceived()" << LL_ENDL; | 503 | LL_DEBUGS("Inventory") << "We didn't get the region caps yet." << LL_ENDL; |
494 | } | 504 | } |
505 | |||
495 | std::string url; | 506 | std::string url; |
496 | if (viewer_region) | 507 | if (viewer_region) |
497 | { | 508 | { |
@@ -517,17 +528,16 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id, | |||
517 | user_data)); | 528 | user_data)); |
518 | return LLUUID::null; | 529 | return LLUUID::null; |
519 | } | 530 | } |
520 | else//awfixme | 531 | else |
521 | { | 532 | { |
522 | LL_DEBUGS("Inventory") << "HIPPOS! cap url empty" << LL_ENDL; | 533 | LL_DEBUGS("Inventory") << "Cap url empty" << LL_ENDL; |
523 | } | 534 | } |
524 | } | 535 | } |
525 | else//awfixme | 536 | else //NULL == user_data |
526 | { | 537 | { |
527 | LL_DEBUGS("Inventory") << "HIPPOS! callback: " | 538 | // user_data is a LLCategoryCreate object instantiated in the calling |
528 | << (callback ? "true" : "false") | 539 | // function - bug (or low memory - any leaks?). |
529 | << "user_data" << ((NULL!= user_data) ? "!NULL" : "NULL") | 540 | llwarns << "NULL user_data" << llendl; |
530 | << LL_ENDL; | ||
531 | } | 541 | } |
532 | 542 | ||
533 | // Add the category to the internal representation | 543 | // Add the category to the internal representation |