From 1dae91d7354aef57625e3508b23a4bb21de242e8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 19 Jul 2010 17:15:32 -0400 Subject: EXT-8360 WIP - propagating COF item name changes various places --- indra/newview/lloutfitobserver.cpp | 42 ++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) (limited to 'indra/newview/lloutfitobserver.cpp') diff --git a/indra/newview/lloutfitobserver.cpp b/indra/newview/lloutfitobserver.cpp index 03414b9964..99835edad2 100644 --- a/indra/newview/lloutfitobserver.cpp +++ b/indra/newview/lloutfitobserver.cpp @@ -40,6 +40,7 @@ LLOutfitObserver::LLOutfitObserver() : mCOFLastVersion(LLViewerInventoryCategory::VERSION_UNKNOWN) { + mItemNameHash.finalize(); gInventory.addObserver(this); } @@ -87,13 +88,25 @@ bool LLOutfitObserver::checkCOF() if (cof.isNull()) return false; + bool cof_changed = false; + LLMD5 itemNameHash; + hashItemNames(itemNameHash); + if (itemNameHash != mItemNameHash) + { + cof_changed = true; + mItemNameHash = itemNameHash; + } + S32 cof_version = getCategoryVersion(cof); + if (cof_version != mCOFLastVersion) + { + cof_changed = true; + mCOFLastVersion = cof_version; + } - if (cof_version == mCOFLastVersion) + if (!cof_changed) return false; - - mCOFLastVersion = cof_version; - + // dirtiness state should be updated before sending signal LLAppearanceMgr::getInstance()->updateIsDirty(); mCOFChanged(); @@ -101,6 +114,27 @@ bool LLOutfitObserver::checkCOF() return true; } +void LLOutfitObserver::hashItemNames(LLMD5& itemNameHash) +{ + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; + gInventory.collectDescendents(LLAppearanceMgr::instance().getCOF(), + cat_array, + item_array, + false); + for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin(); + iter != item_array.end(); + iter++) + { + const LLViewerInventoryItem *item = (*iter); + if (!item) + continue; + const std::string& name = item->getName(); + itemNameHash.update(name); + } + itemNameHash.finalize(); +} + void LLOutfitObserver::checkBaseOutfit() { LLUUID baseoutfit_id = -- cgit v1.2.3 From ca1224fd7968edebfcd274c21439ca74340efc26 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 20 Jul 2010 10:44:27 -0400 Subject: EXT-8360 FIX - item name changes get propagated to the various appearance panel widgets --- indra/newview/lloutfitobserver.cpp | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) (limited to 'indra/newview/lloutfitobserver.cpp') diff --git a/indra/newview/lloutfitobserver.cpp b/indra/newview/lloutfitobserver.cpp index 99835edad2..60c941b456 100644 --- a/indra/newview/lloutfitobserver.cpp +++ b/indra/newview/lloutfitobserver.cpp @@ -89,12 +89,11 @@ bool LLOutfitObserver::checkCOF() return false; bool cof_changed = false; - LLMD5 itemNameHash; - hashItemNames(itemNameHash); - if (itemNameHash != mItemNameHash) + LLMD5 item_name_hash = gInventory.hashDirectDescendentNames(cof); + if (item_name_hash != mItemNameHash) { cof_changed = true; - mItemNameHash = itemNameHash; + mItemNameHash = item_name_hash; } S32 cof_version = getCategoryVersion(cof); @@ -114,27 +113,6 @@ bool LLOutfitObserver::checkCOF() return true; } -void LLOutfitObserver::hashItemNames(LLMD5& itemNameHash) -{ - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t item_array; - gInventory.collectDescendents(LLAppearanceMgr::instance().getCOF(), - cat_array, - item_array, - false); - for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin(); - iter != item_array.end(); - iter++) - { - const LLViewerInventoryItem *item = (*iter); - if (!item) - continue; - const std::string& name = item->getName(); - itemNameHash.update(name); - } - itemNameHash.finalize(); -} - void LLOutfitObserver::checkBaseOutfit() { LLUUID baseoutfit_id = -- cgit v1.2.3