summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneloutfitedit.cpp
diff options
context:
space:
mode:
authorIgor Borovkov <iborovkov@productengine.com>2010-07-09 17:47:33 +0300
committerIgor Borovkov <iborovkov@productengine.com>2010-07-09 17:47:33 +0300
commiteaf114fdfd7967178c168c907ca24f2faa97a7cf (patch)
treed400c4fc8159204edac63cdc8a04bd4142ed847e /indra/newview/llpaneloutfitedit.cpp
parentb6b0465bbcb4c05e1c0a000224dd03b54afa477f (diff)
EXT-7786 FIXED COF Wearables List is updated only when visible (panel outfit eidt)
Every single delete/create operation in the COF causes LLCOFWearables to be updated - on each update its contained LLFlatListView is repopulated. That means massive creation of LLPanel's instances (LLUICtrlFactory::buildPanel(...)). Half of the panel creation time is spent in the EXPAT xml library on parsing the .xml files of the panel item. I've forbidden updates of LLCOFWearables when Panel Outfit Edit is not in the visible chain. Panel Outfit Edit is now updated only when it is visible Also LLCOFWearables refures to refresh its content if COF category version hasn't been changed since the last refresh. Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/715 --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llpaneloutfitedit.cpp')
-rw-r--r--indra/newview/llpaneloutfitedit.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index f8350a56ef..827ecb1c92 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -263,7 +263,7 @@ LLPanelOutfitEdit::LLPanelOutfitEdit()
observer.addBOFReplacedCallback(boost::bind(&LLPanelOutfitEdit::updateCurrentOutfitName, this));
observer.addBOFChangedCallback(boost::bind(&LLPanelOutfitEdit::updateVerbs, this));
observer.addOutfitLockChangedCallback(boost::bind(&LLPanelOutfitEdit::updateVerbs, this));
- observer.addCOFChangedCallback(boost::bind(&LLPanelOutfitEdit::update, this));
+ observer.addCOFChangedCallback(boost::bind(&LLPanelOutfitEdit::onCOFChanged, this));
gAgentWearables.addLoadingStartedCallback(boost::bind(&LLPanelOutfitEdit::onOutfitChanging, this, true));
gAgentWearables.addLoadedCallback(boost::bind(&LLPanelOutfitEdit::onOutfitChanging, this, false));
@@ -331,7 +331,7 @@ BOOL LLPanelOutfitEdit::postBuild()
childSetCommitCallback("shop_btn_1", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), NULL);
childSetCommitCallback("shop_btn_2", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), NULL);
- setVisibleCallback(boost::bind(&LLPanelOutfitEdit::onVisibilityChange, this));
+ setVisibleCallback(boost::bind(&LLPanelOutfitEdit::onVisibilityChange, this, _2));
mCOFWearables = getChild<LLCOFWearables>("cof_wearables_list");
mCOFWearables->setCommitCallback(boost::bind(&LLPanelOutfitEdit::filterWearablesBySelectedItem, this));
@@ -583,11 +583,16 @@ void LLPanelOutfitEdit::onPlusBtnClicked(void)
}
}
-void LLPanelOutfitEdit::onVisibilityChange()
+void LLPanelOutfitEdit::onVisibilityChange(const LLSD &in_visible_chain)
{
showAddWearablesPanel(false);
mWearableItemsList->resetSelection();
mInventoryItemsPanel->clearSelection();
+
+ if (in_visible_chain.asBoolean())
+ {
+ update();
+ }
}
void LLPanelOutfitEdit::onAddWearableClicked(void)
@@ -1014,5 +1019,13 @@ void LLPanelOutfitEdit::getSelectedItemsUUID(uuid_vec_t& uuid_list)
// return selected_id;
}
+void LLPanelOutfitEdit::onCOFChanged()
+{
+ //the panel is only updated when is visible to a user
+ if (!isInVisibleChain()) return;
+
+ update();
+}
+
// EOF