diff options
| author | Oz Linden <oz@lindenlab.com> | 2014-04-21 16:21:31 -0400 |
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2014-04-21 16:21:31 -0400 |
| commit | b1a7137ba6e56e1b692205f129d86acc942209e9 (patch) | |
| tree | 595b9e3a2b9e4be799459e06c9b33793013d0ae0 /indra/newview/llinventoryobserver.cpp | |
| parent | 32bbb07f0a727b5aa318ba3c32764ec29cc96956 (diff) | |
| parent | c71e459bed68c1602d409e5c946c5e016d09d105 (diff) | |
merge changes for 3.7.6-release
Diffstat (limited to 'indra/newview/llinventoryobserver.cpp')
| -rwxr-xr-x | indra/newview/llinventoryobserver.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 9db175ec2e..16427f2016 100755 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -690,15 +690,24 @@ void LLInventoryCategoriesObserver::changed(U32 mask) if (!mCategoryMap.size()) return; + std::vector<LLUUID> deleted_categories_ids; + for (category_map_t::iterator iter = mCategoryMap.begin(); iter != mCategoryMap.end(); ++iter) { const LLUUID& cat_id = (*iter).first; - + LLCategoryData& cat_data = (*iter).second; + LLViewerInventoryCategory* category = gInventory.getCategory(cat_id); if (!category) + { + llwarns << "Category : Category id = " << cat_id << " disappeared" << llendl; + cat_data.mCallback(); + // Keep track of those deleted categories so we can remove them + deleted_categories_ids.push_back(cat_id); continue; + } const S32 version = category->getVersion(); const S32 expected_num_descendents = category->getDescendentCount(); @@ -726,8 +735,6 @@ void LLInventoryCategoriesObserver::changed(U32 mask) const S32 current_num_known_descendents = cats->count() + items->count(); - LLCategoryData& cat_data = (*iter).second; - bool cat_changed = false; // If category version or descendents count has changed @@ -757,6 +764,12 @@ void LLInventoryCategoriesObserver::changed(U32 mask) if (cat_changed) cat_data.mCallback(); } + + // Remove deleted categories from the list + for (std::vector<LLUUID>::iterator deleted_id = deleted_categories_ids.begin(); deleted_id != deleted_categories_ids.end(); ++deleted_id) + { + removeCategory(*deleted_id); + } } bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t cb) |
