From bce40a19348a35f5e223cf740e4ba7e96314286b Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Wed, 18 Jul 2018 19:59:00 +0300 Subject: Backed out changeset: 1d9ad7f485e6 --- indra/newview/llinventorymodel.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 76bf87cfe5..bedf11d7e4 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -344,23 +344,13 @@ LLViewerInventoryCategory* LLInventoryModel::getCategory(const LLUUID& id) const 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 (cat_type == LLFolderType::FT_INBOX || cat_type == LLFolderType::FT_OUTBOX); } - return res; + return false; } S32 LLInventoryModel::getItemCount() const -- cgit v1.2.3 From e37c30d5cd247d4dcefa1cf8e9e83fa8d8c25470 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Wed, 18 Jul 2018 19:59:31 +0300 Subject: Backed out changeset: 43f9351c7f6f --- indra/newview/llinventorymodel.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index bedf11d7e4..b447166764 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -342,17 +342,6 @@ LLViewerInventoryCategory* LLInventoryModel::getCategory(const LLUUID& id) const return category; } -bool LLInventoryModel::isCategoryHidden(const LLUUID& id) const -{ - const LLViewerInventoryCategory* category = getCategory(id); - if (category) - { - LLFolderType::EType cat_type = category->getPreferredType(); - return (cat_type == LLFolderType::FT_INBOX || cat_type == LLFolderType::FT_OUTBOX); - } - return false; -} - S32 LLInventoryModel::getItemCount() const { return mItemMap.size(); -- cgit v1.2.3 From 4dd88ee738da3851d4cf5f8ffc3058948076c53d Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 1 Aug 2018 17:41:34 +0300 Subject: MAINT-8803 Better UI handling of unrecognized inventory items --- indra/newview/llinventorymodel.cpp | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'indra/newview/llinventorymodel.cpp') 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 -- cgit v1.2.3