diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-07-10 13:52:05 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-07-10 13:52:05 +0100 |
commit | 5190e7c1bb75e6c8f8396eef5a74b03cb2237b86 (patch) | |
tree | 80323b5d1c4d0fc90f796b3af3dac834af8c8b3e /indra/newview/llcofwearables.cpp | |
parent | ee50934d886b07c85e3be0515ff3e53625052faa (diff) | |
parent | 331ccee1f5cea9fab944c934b3beeb70fc7f6504 (diff) |
merge from PE's viewer-release
Diffstat (limited to 'indra/newview/llcofwearables.cpp')
-rw-r--r-- | indra/newview/llcofwearables.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index 88782e35dc..86d9121213 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -283,7 +283,8 @@ LLCOFWearables::LLCOFWearables() : LLPanel(), mClothingTab(NULL), mAttachmentsTab(NULL), mBodyPartsTab(NULL), - mLastSelectedTab(NULL) + mLastSelectedTab(NULL), + mCOFVersion(-1) { mClothingMenu = new CofClothingContextMenu(this); mAttachmentMenu = new CofAttachmentContextMenu(this); @@ -378,6 +379,23 @@ void LLCOFWearables::onAccordionTabStateChanged(LLUICtrl* ctrl, const LLSD& expa void LLCOFWearables::refresh() { + const LLUUID cof_id = LLAppearanceMgr::instance().getCOF(); + if (cof_id.isNull()) + { + llwarns << "COF ID cannot be NULL" << llendl; + return; + } + + LLViewerInventoryCategory* catp = gInventory.getCategory(cof_id); + if (!catp) + { + llwarns << "COF category cannot be NULL" << llendl; + return; + } + + if (mCOFVersion == catp->getVersion()) return; + mCOFVersion = catp->getVersion(); + typedef std::vector<LLSD> values_vector_t; typedef std::map<LLFlatListView*, values_vector_t> selection_map_t; @@ -393,7 +411,7 @@ void LLCOFWearables::refresh() LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t cof_items; - gInventory.collectDescendents(LLAppearanceMgr::getInstance()->getCOF(), cats, cof_items, LLInventoryModel::EXCLUDE_TRASH); + gInventory.collectDescendents(cof_id, cats, cof_items, LLInventoryModel::EXCLUDE_TRASH); populateAttachmentsAndBodypartsLists(cof_items); |