summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindra/newview/llappearancemgr.cpp7
-rwxr-xr-xindra/newview/llinventorymodel.cpp30
-rwxr-xr-xindra/newview/llviewerinventory.cpp13
-rwxr-xr-xindra/newview/llviewerinventory.h2
4 files changed, 25 insertions, 27 deletions
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 43ba66f8c5..f6c9bf6953 100755
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -2124,6 +2124,13 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions,
dumpItemArray(wear_items,"asset_dump: wear_item");
dumpItemArray(obj_items,"asset_dump: obj_item");
+ LLViewerInventoryCategory *cof = gInventory.getCategory(current_outfit_id);
+ if (!gInventory.isCategoryComplete(current_outfit_id))
+ {
+ llwarns << "COF info is not complete. Version " << cof->getVersion()
+ << " descendent_count " << cof->getDescendentCount()
+ << " viewer desc count " << cof->getViewerDescendentCount() << llendl;
+ }
if(!wear_items.count())
{
LLNotificationsUtil::add("CouldNotPutOnOutfit");
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 3dbc1ae288..52b6e4bf3b 100755
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -105,17 +105,7 @@ bool LLCanCache::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
if(c->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN)
{
S32 descendents_server = c->getDescendentCount();
- LLInventoryModel::cat_array_t* cats;
- LLInventoryModel::item_array_t* items;
- mModel->getDirectDescendentsOf(
- c->getUUID(),
- cats,
- items);
- S32 descendents_actual = 0;
- if(cats && items)
- {
- descendents_actual = cats->count() + items->count();
- }
+ S32 descendents_actual = c->getViewerDescendentCount();
if(descendents_server == descendents_actual)
{
mCachedCatIDs.insert(c->getUUID());
@@ -1717,14 +1707,7 @@ void LLInventoryModel::accountForUpdate(const LLCategoryUpdate& update) const
if(version != LLViewerInventoryCategory::VERSION_UNKNOWN)
{
S32 descendents_server = cat->getDescendentCount();
- LLInventoryModel::cat_array_t* cats;
- LLInventoryModel::item_array_t* items;
- getDirectDescendentsOf(update.mCategoryID, cats, items);
- S32 descendents_actual = 0;
- if(cats && items)
- {
- descendents_actual = cats->count() + items->count();
- }
+ S32 descendents_actual = cat->getViewerDescendentCount();
if(descendents_server == descendents_actual)
{
descendents_actual += update.mDescendentDelta;
@@ -1821,14 +1804,7 @@ bool LLInventoryModel::isCategoryComplete(const LLUUID& cat_id) const
if(cat && (cat->getVersion()!=LLViewerInventoryCategory::VERSION_UNKNOWN))
{
S32 descendents_server = cat->getDescendentCount();
- LLInventoryModel::cat_array_t* cats;
- LLInventoryModel::item_array_t* items;
- getDirectDescendentsOf(cat_id, cats, items);
- S32 descendents_actual = 0;
- if(cats && items)
- {
- descendents_actual = cats->count() + items->count();
- }
+ S32 descendents_actual = cat->getViewerDescendentCount();
if(descendents_server == descendents_actual)
{
return true;
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index b6a5534815..2d9fb7d773 100755
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -701,6 +701,19 @@ bool LLViewerInventoryCategory::fetch()
return false;
}
+S32 LLViewerInventoryCategory::getViewerDescendentCount() const
+{
+ LLInventoryModel::cat_array_t* cats;
+ LLInventoryModel::item_array_t* items;
+ gInventory.getDirectDescendentsOf(getUUID(), cats, items);
+ S32 descendents_actual = 0;
+ if(cats && items)
+ {
+ descendents_actual = cats->count() + items->count();
+ }
+ return descendents_actual;
+}
+
bool LLViewerInventoryCategory::importFileLocal(LLFILE* fp)
{
// *NOTE: This buffer size is hard coded into scanf() below.
diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h
index c82c2b6fbe..2e662d1730 100755
--- a/indra/newview/llviewerinventory.h
+++ b/indra/newview/llviewerinventory.h
@@ -217,6 +217,8 @@ public:
enum { DESCENDENT_COUNT_UNKNOWN = -1 };
S32 getDescendentCount() const { return mDescendentCount; }
void setDescendentCount(S32 descendents) { mDescendentCount = descendents; }
+ // How many descendents do we currently have information for in the InventoryModel?
+ S32 getViewerDescendentCount() const;
// file handling on the viewer. These are not meant for anything
// other than caching.