diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2018-08-03 13:01:38 +0000 |
|---|---|---|
| committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2018-08-03 13:01:38 +0000 |
| commit | 07f8c156fc85a6efee057660a5e4b63ad3528291 (patch) | |
| tree | 20ca83906b4449d48acc9d531702103b5ca44c4a /indra/newview/llinventorymodel.cpp | |
| parent | 4cd1e05e52269e86b952385253f5b52f6dc14503 (diff) | |
| parent | 4dd88ee738da3851d4cf5f8ffc3058948076c53d (diff) | |
Merged in MAINT-8803
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
| -rw-r--r-- | indra/newview/llinventorymodel.cpp | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index b447166764..2b9607f7a2 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1810,11 +1810,7 @@ void LLInventoryModel::addItem(LLViewerInventoryItem* item) llassert(item); if(item) { - // This can happen if assettype enums from llassettype.h ever change. - // For example, there is a known backwards compatibility issue in some viewer prototypes prior to when - // the AT_LINK enum changed from 23 to 24. - if ((item->getType() == LLAssetType::AT_NONE) - || LLAssetType::lookup(item->getType()) == LLAssetType::badLookup()) + if (item->getType() <= LLAssetType::AT_NONE) { LL_WARNS(LOG_INV) << "Got bad asset type for item [ name: " << item->getName() << " type: " << item->getType() @@ -1822,6 +1818,13 @@ void LLInventoryModel::addItem(LLViewerInventoryItem* item) return; } + if (LLAssetType::lookup(item->getType()) == LLAssetType::badLookup()) + { + LL_WARNS(LOG_INV) << "Got unknown asset type for item [ name: " << item->getName() + << " type: " << item->getType() + << " inv-type: " << item->getInventoryType() << " ]." << LL_ENDL; + } + // This condition means that we tried to add a link without the baseobj being in memory. // The item will show up as a broken link. if (item->getIsBrokenLink()) @@ -2030,6 +2033,7 @@ bool LLInventoryModel::loadSkeleton( update_map_t child_counts; cat_array_t categories; item_array_t items; + changed_items_t categories_to_update; item_array_t possible_broken_links; cat_set_t invalid_categories; // Used to mark categories that weren't successfully loaded. std::string inventory_filename = getInvCacheAddres(owner_id); @@ -2055,7 +2059,7 @@ bool LLInventoryModel::loadSkeleton( } } bool is_cache_obsolete = false; - if(loadFromFile(inventory_filename, categories, items, is_cache_obsolete)) + if (loadFromFile(inventory_filename, categories, items, categories_to_update, is_cache_obsolete)) { // We were able to find a cache of files. So, use what we // found to generate a set of categories we should add. We @@ -2073,6 +2077,12 @@ bool LLInventoryModel::loadSkeleton( continue; // cache corruption?? not sure why this happens -SJB } LLViewerInventoryCategory* tcat = *cit; + + if (categories_to_update.find(tcat->getUUID()) != categories_to_update.end()) + { + tcat->setVersion(NO_VERSION); + LL_WARNS() << "folder to update: " << tcat->getName() << LL_ENDL; + } // we can safely ignore anything loaded from file, but // not sent down in the skeleton. Must have been removed from inventory. @@ -2621,6 +2631,7 @@ bool LLUUIDAndName::operator>(const LLUUIDAndName& rhs) const bool LLInventoryModel::loadFromFile(const std::string& filename, LLInventoryModel::cat_array_t& categories, LLInventoryModel::item_array_t& items, + LLInventoryModel::changed_items_t& cats_to_update, bool &is_cache_obsolete) { if(filename.empty()) @@ -2695,7 +2706,14 @@ bool LLInventoryModel::loadFromFile(const std::string& filename, } else { - items.push_back(inv_item); + if (inv_item->getType() == LLAssetType::AT_UNKNOWN) + { + cats_to_update.insert(inv_item->getParentUUID()); + } + else + { + items.push_back(inv_item); + } } } else |
