diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-08-24 18:44:39 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-08-24 18:44:39 +0100 |
commit | 98cc2365034a93c69704daa69efb389799cc9627 (patch) | |
tree | 4c3ec75b78a26a736f18a2153af025040ae05a4b /indra/newview/lloutfitslist.cpp | |
parent | 6ba23344c95157793af9e4154933ae8df61630e8 (diff) |
Backed out changeset a62bf7c0af21
Backing out this merge that I pushed (prematurely) to the wrong place.
Diffstat (limited to 'indra/newview/lloutfitslist.cpp')
-rw-r--r-- | indra/newview/lloutfitslist.cpp | 54 |
1 files changed, 16 insertions, 38 deletions
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 51f9a03a9c..3eda077b87 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -398,12 +398,6 @@ void LLOutfitsList::onOpen(const LLSD& /*info*/) mIsInitialized = true; } - - LLAccordionCtrlTab* selected_tab = mAccordion->getSelectedTab(); - if (!selected_tab) return; - - // Pass focus to the selected outfit tab. - selected_tab->showAndFocusHeader(); } void LLOutfitsList::refreshList(const LLUUID& category_id) @@ -1056,37 +1050,25 @@ void LLOutfitsList::onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y) void LLOutfitsList::onCOFChanged() { - LLInventoryModel::cat_array_t cat_array; - LLInventoryModel::item_array_t item_array; - - // Collect current COF items - gInventory.collectDescendents( - LLAppearanceMgr::instance().getCOF(), - cat_array, - item_array, - LLInventoryModel::EXCLUDE_TRASH); - - uuid_vec_t vnew; - uuid_vec_t vadded; - uuid_vec_t vremoved; + LLInventoryModel::changed_items_t changed_linked_items; - // From gInventory we get the UUIDs of links that are currently in COF. - // These links UUIDs are not the same UUIDs that we have in each wearable items list. - // So we collect base items' UUIDs to find them or links that point to them in wearable - // items lists and update their worn state there. - for (LLInventoryModel::item_array_t::const_iterator iter = item_array.begin(); - iter != item_array.end(); - ++iter) + const LLInventoryModel::changed_items_t& changed_items = gInventory.getChangedIDs(); + for (LLInventoryModel::changed_items_t::const_iterator iter = changed_items.begin(); + iter != changed_items.end(); + ++iter) { - vnew.push_back((*iter)->getLinkedUUID()); + LLViewerInventoryItem* item = gInventory.getItem(*iter); + if (item) + { + // From gInventory we get the UUIDs of new links added to COF + // or removed from COF. These links UUIDs are not the same UUIDs + // that we have in each wearable items list. So we collect base items + // UUIDs to find all items or links that point to same base items in wearable + // items lists and update their worn state there. + changed_linked_items.insert(item->getLinkedUUID()); + } } - // We need to update only items that were added or removed from COF. - LLCommonUtils::computeDifference(vnew, mCOFLinkedItems, vadded, vremoved); - - // Store the ids of items currently linked from COF. - mCOFLinkedItems = vnew; - for (outfits_map_t::iterator iter = mOutfitsMap.begin(); iter != mOutfitsMap.end(); ++iter) @@ -1097,13 +1079,9 @@ void LLOutfitsList::onCOFChanged() LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(tab->getAccordionView()); if (!list) continue; - // Append removed ids to added ids because we should update all of them. - vadded.reserve(vadded.size() + vremoved.size()); - vadded.insert(vadded.end(), vremoved.begin(), vremoved.end()); - // Every list updates the labels of changed items or // the links that point to these items. - list->updateChangedItems(vadded); + list->updateChangedItems(changed_linked_items); } } |