summaryrefslogtreecommitdiff
path: root/indra/newview/lloutfitslist.cpp
diff options
context:
space:
mode:
authorEugene Mutavchi <emutavchi@productengine.com>2010-04-30 18:27:24 +0300
committerEugene Mutavchi <emutavchi@productengine.com>2010-04-30 18:27:24 +0300
commitd6edc4cd12c015003cd665028b69a7b34b3aa54f (patch)
tree58ffcac02b74dab72a7260e99d2d2bb87ed1b6de /indra/newview/lloutfitslist.cpp
parent779bf4bb59e9c8d832de84bc926e8839827735b7 (diff)
Implemented normal EXT-7002 (Inventory flat list needs optimization.):
- changed the LLInventoryItemsList::addNewItem() to add item to the list without immediately rearranging - implemented LLFlatListViewEx::setFilterSubString(), sets up new filter string and filters the list. - implemented LLFlatListViewEx::filterItems(), filters the list, rearranges and notifies parent about shape changes. The list items are filtered using the notify() functionality, without need in adding/removing them on each filter call. It sends 'match_filter' request to items and interprets the returned zero as sign of matched filter string, i.e. we don't hide items that don't support 'match_filter' action(separators etc). - filtring of LLOutfitsList. Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/342/ --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/lloutfitslist.cpp')
-rw-r--r--indra/newview/lloutfitslist.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp
index b103ec45d0..18bd610dd9 100644
--- a/indra/newview/lloutfitslist.cpp
+++ b/indra/newview/lloutfitslist.cpp
@@ -245,6 +245,34 @@ void LLOutfitsList::performAction(std::string action)
void LLOutfitsList::setFilterSubString(const std::string& string)
{
mFilterSubString = string;
+
+ for (outfits_map_t::iterator
+ iter = mOutfitsMap.begin(),
+ iter_end = mOutfitsMap.end();
+ iter != iter_end; ++iter)
+ {
+ LLAccordionCtrlTab* tab = iter->second;
+ if (tab)
+ {
+ LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*> (tab->getAccordionView());
+ if (list)
+ {
+ list->setFilterSubString(mFilterSubString);
+ }
+
+ if(!mFilterSubString.empty())
+ {
+ //store accordion tab state when filter is not empty
+ tab->notifyChildren(LLSD().with("action","store_state"));
+ tab->setDisplayChildren(true);
+ }
+ else
+ {
+ //restore accordion state after all those accodrion tab manipulations
+ tab->notifyChildren(LLSD().with("action","restore_state"));
+ }
+ }
+ }
}
//////////////////////////////////////////////////////////////////////////