aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
authorMcCabe Maxsted2011-05-07 18:27:37 -0700
committerMcCabe Maxsted2011-06-08 21:57:38 -0700
commit7dd70e2f154c537689926795e2177cfb4843631c (patch)
treee702e50f6f4e61bd3074a8c786b21b26b5d0f3e2 /linden
parentchanged several lldebugs to LL_DEBUGS(Inventory) (diff)
downloadmeta-impy-7dd70e2f154c537689926795e2177cfb4843631c.zip
meta-impy-7dd70e2f154c537689926795e2177cfb4843631c.tar.gz
meta-impy-7dd70e2f154c537689926795e2177cfb4843631c.tar.bz2
meta-impy-7dd70e2f154c537689926795e2177cfb4843631c.tar.xz
Committing some more useful debugging lines
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/newview/llinventorymodel.cpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/linden/indra/newview/llinventorymodel.cpp b/linden/indra/newview/llinventorymodel.cpp
index 5c1ae22..ede54a3 100644
--- a/linden/indra/newview/llinventorymodel.cpp
+++ b/linden/indra/newview/llinventorymodel.cpp
@@ -2528,6 +2528,7 @@ bool LLInventoryModel::loadFromFile(const std::string& filename,
2528 // *NOTE: This buffer size is hard coded into scanf() below. 2528 // *NOTE: This buffer size is hard coded into scanf() below.
2529 char buffer[MAX_STRING]; /*Flawfinder: ignore*/ 2529 char buffer[MAX_STRING]; /*Flawfinder: ignore*/
2530 char keyword[MAX_STRING]; /*Flawfinder: ignore*/ 2530 char keyword[MAX_STRING]; /*Flawfinder: ignore*/
2531 static S32 item_count_total = 0;
2531 while(!feof(file) && fgets(buffer, MAX_STRING, file)) 2532 while(!feof(file) && fgets(buffer, MAX_STRING, file))
2532 { 2533 {
2533 sscanf(buffer, " %254s", keyword); /* Flawfinder: ignore */ 2534 sscanf(buffer, " %254s", keyword); /* Flawfinder: ignore */
@@ -2552,16 +2553,17 @@ bool LLInventoryModel::loadFromFile(const std::string& filename,
2552 // *FIX: Need a better solution, this prevents the 2553 // *FIX: Need a better solution, this prevents the
2553 // application from freezing, but breaks inventory 2554 // application from freezing, but breaks inventory
2554 // caching. 2555 // caching.
2555 if(inv_item->getUUID().isNull()) 2556 //if(inv_item->getUUID().isNull())MCCABE
2556 { 2557 //{
2557 //delete inv_item; // automatic when inv_cat is reassigned or destroyed 2558 // //delete inv_item; // automatic when inv_cat is reassigned or destroyed
2558 llwarns << "Ignoring inventory with null item id: " 2559 // llwarns << "Ignoring inventory with null item id: "
2559 << inv_item->getName() << llendl; 2560 // << inv_item->getName() << llendl;
2560 2561 //
2561 } 2562 //}
2562 else 2563 //else
2563 { 2564 {
2564 items.put(inv_item); 2565 items.put(inv_item);
2566 item_count_total++;
2565 } 2567 }
2566 } 2568 }
2567 else 2569 else
@@ -2576,6 +2578,7 @@ bool LLInventoryModel::loadFromFile(const std::string& filename,
2576 << llendl; 2578 << llendl;
2577 } 2579 }
2578 } 2580 }
2581 LL_DEBUGS("Inventory") << "Inventory items loaded from file: " << item_count_total << LL_ENDL;
2579 fclose(file); 2582 fclose(file);
2580 return true; 2583 return true;
2581} 2584}
@@ -2598,6 +2601,9 @@ bool LLInventoryModel::saveToFile(const std::string& filename,
2598 return false; 2601 return false;
2599 } 2602 }
2600 2603
2604 static S32 count_total = 0;
2605 static S32 category_total = 0;
2606
2601 S32 count = categories.count(); 2607 S32 count = categories.count();
2602 S32 i; 2608 S32 i;
2603 for(i = 0; i < count; ++i) 2609 for(i = 0; i < count; ++i)
@@ -2606,6 +2612,7 @@ bool LLInventoryModel::saveToFile(const std::string& filename,
2606 if(cat->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN) 2612 if(cat->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN)
2607 { 2613 {
2608 cat->exportFileLocal(file); 2614 cat->exportFileLocal(file);
2615 category_total++;
2609 } 2616 }
2610 } 2617 }
2611 2618
@@ -2613,8 +2620,11 @@ bool LLInventoryModel::saveToFile(const std::string& filename,
2613 for(i = 0; i < count; ++i) 2620 for(i = 0; i < count; ++i)
2614 { 2621 {
2615 items[i]->exportFile(file); 2622 items[i]->exportFile(file);
2623 count_total++;
2616 } 2624 }
2617 2625
2626 LL_DEBUGS("Inventory") << "Cached " << category_total << " categories and " << count_total << " inventory items" << LL_ENDL;
2627
2618 fclose(file); 2628 fclose(file);
2619 return true; 2629 return true;
2620} 2630}