summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorymodel.cpp
diff options
context:
space:
mode:
authormaxim_productengine <mnikolenko@productengine.com>2018-08-01 17:41:34 +0300
committermaxim_productengine <mnikolenko@productengine.com>2018-08-01 17:41:34 +0300
commit4dd88ee738da3851d4cf5f8ffc3058948076c53d (patch)
tree385943f64a7d9bf28693c4ee464d2f245d05602f /indra/newview/llinventorymodel.cpp
parent344d02af4fd568e5a55e1ed0a1a935fb4718d364 (diff)
MAINT-8803 Better UI handling of unrecognized inventory items
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r--indra/newview/llinventorymodel.cpp32
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