summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryobserver.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2010-07-20 10:44:27 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2010-07-20 10:44:27 -0400
commitca1224fd7968edebfcd274c21439ca74340efc26 (patch)
tree3589b61799fe369e030a22c217dee7ecd7530874 /indra/newview/llinventoryobserver.cpp
parent22232ccf050e34841c248ea29fed8f64b8abab6b (diff)
EXT-8360 FIX - item name changes get propagated to the various appearance panel widgets
Diffstat (limited to 'indra/newview/llinventoryobserver.cpp')
-rw-r--r--indra/newview/llinventoryobserver.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp
index bd6877d9d3..5416f01033 100644
--- a/indra/newview/llinventoryobserver.cpp
+++ b/indra/newview/llinventoryobserver.cpp
@@ -676,7 +676,9 @@ void LLInventoryCategoriesObserver::changed(U32 mask)
iter != mCategoryMap.end();
++iter)
{
- LLViewerInventoryCategory* category = gInventory.getCategory((*iter).first);
+ const LLUUID& cat_id = (*iter).first;
+
+ LLViewerInventoryCategory* category = gInventory.getCategory(cat_id);
if (!category)
continue;
@@ -691,7 +693,7 @@ void LLInventoryCategoriesObserver::changed(U32 mask)
// Check number of known descendents to find out whether it has changed.
LLInventoryModel::cat_array_t* cats;
LLInventoryModel::item_array_t* items;
- gInventory.getDirectDescendentsOf((*iter).first, cats, items);
+ gInventory.getDirectDescendentsOf(cat_id, cats, items);
if (!cats || !items)
{
llwarns << "Category '" << category->getName() << "' descendents corrupted, fetch failed." << llendl;
@@ -703,20 +705,33 @@ void LLInventoryCategoriesObserver::changed(U32 mask)
continue;
}
-
+
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
- // update category data in mCategoryMap and fire a callback.
+ // update category data in mCategoryMap
if (version != cat_data.mVersion || current_num_known_descendents != cat_data.mDescendentsCount)
{
cat_data.mVersion = version;
cat_data.mDescendentsCount = current_num_known_descendents;
+ cat_changed = true;
+ }
- cat_data.mCallback();
+ // If any item names have changed, update the name hash
+ LLMD5 item_name_hash = gInventory.hashDirectDescendentNames(cat_id);
+ if (cat_data.mItemNameHash != item_name_hash)
+ {
+ cat_data.mItemNameHash = item_name_hash;
+ cat_changed = true;
}
+
+ // If anything has changed above, fire the callback.
+ if (cat_changed)
+ cat_data.mCallback();
}
}