summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorymodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r--indra/newview/llinventorymodel.cpp53
1 files changed, 25 insertions, 28 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 76bf87cfe5..2b9607f7a2 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -342,27 +342,6 @@ LLViewerInventoryCategory* LLInventoryModel::getCategory(const LLUUID& id) const
return category;
}
-bool LLInventoryModel::isCategoryHidden(const LLUUID& id) const
-{
- bool res = false;
- const LLViewerInventoryCategory* category = getCategory(id);
- if (category)
- {
- LLFolderType::EType cat_type = category->getPreferredType();
- switch (cat_type)
- {
- case LLFolderType::FT_INBOX:
- case LLFolderType::FT_OUTBOX:
- case LLFolderType::FT_MARKETPLACE_LISTINGS:
- res = true;
- break;
- default:
- break;
- }
- }
- return res;
-}
-
S32 LLInventoryModel::getItemCount() const
{
return mItemMap.size();
@@ -1831,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()
@@ -1843,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())
@@ -2051,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);
@@ -2076,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
@@ -2094,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.
@@ -2642,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())
@@ -2716,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