SH-4578 WIP - cleaner folder version accounting
parent
c1f60e7f2f
commit
8179175e6e
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue