diff options
author | Andrew Dyukov <adyukov@productengine.com> | 2010-06-24 16:51:15 +0300 |
---|---|---|
committer | Andrew Dyukov <adyukov@productengine.com> | 2010-06-24 16:51:15 +0300 |
commit | cb801fafb2cce28d2eecd87f011bc50eae686f1b (patch) | |
tree | 22dcb49c948ecb1020438617aaa05c6f38d1faf5 | |
parent | f5f43b5d3aba3071009d9caa63de1426699e19ec (diff) |
Comments: EXT-7158 ADDITIONAL FIX Slight changes to fix according to review
Added additional check to avoid deselcting of items when filter is applied and made a couple of renames according to Mike's comments in review at https://codereview.productengine.com/secondlife/r/648/
--HG--
branch : product-engine
-rw-r--r-- | indra/llui/llflatlistview.cpp | 15 | ||||
-rw-r--r-- | indra/llui/llflatlistview.h | 4 | ||||
-rw-r--r-- | indra/newview/lloutfitslist.cpp | 2 |
3 files changed, 12 insertions, 9 deletions
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp index f22b49f30f..b87851490d 100644 --- a/indra/llui/llflatlistview.cpp +++ b/indra/llui/llflatlistview.cpp @@ -1227,7 +1227,7 @@ LLFlatListViewEx::LLFlatListViewEx(const Params& p) , mNoFilteredItemsMsg(p.no_filtered_items_msg) , mNoItemsMsg(p.no_items_msg) , mForceShowingUnmatchedItems(false) -, mLastFilterSucceded(false) +, mHasMatchedItems(false) { } @@ -1285,7 +1285,7 @@ void LLFlatListViewEx::filterItems() item_panel_list_t items; getItems(items); - mLastFilterSucceded = false; + mHasMatchedItems = false; for (item_panel_list_t::iterator iter = items.begin(), iter_end = items.end(); @@ -1296,13 +1296,16 @@ void LLFlatListViewEx::filterItems() // i.e. we don't hide items that don't support 'match_filter' action, separators etc. if (0 == pItem->notify(action)) { - mLastFilterSucceded = true; + mHasMatchedItems = true; pItem->setVisible(true); } else { // TODO: implement (re)storing of current selection. - selectItem(pItem, false); + if(!mForceShowingUnmatchedItems) + { + selectItem(pItem, false); + } pItem->setVisible(mForceShowingUnmatchedItems); } } @@ -1311,9 +1314,9 @@ void LLFlatListViewEx::filterItems() notifyParentItemsRectChanged(); } -bool LLFlatListViewEx::wasLasFilterSuccessfull() +bool LLFlatListViewEx::hasMatchedItems() { - return mLastFilterSucceded; + return mHasMatchedItems; } //EOF diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h index caeddfc179..ded46d8122 100644 --- a/indra/llui/llflatlistview.h +++ b/indra/llui/llflatlistview.h @@ -488,7 +488,7 @@ public: /** * Returns true if last call of filterItems() found at least one matching item */ - bool wasLasFilterSuccessfull(); + bool hasMatchedItems(); protected: LLFlatListViewEx(const Params& p); @@ -512,7 +512,7 @@ private: /** * True if last call of filterItems() found at least one matching item */ - bool mLastFilterSucceded; + bool mHasMatchedItems; }; #endif diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index d9c31b4d1c..ec7fb06c8e 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -914,7 +914,7 @@ void LLOutfitsList::applyFilterToTab( { // hide tab if its title doesn't pass filter // and it has no visible items - tab->setVisible(list->wasLasFilterSuccessfull()); + tab->setVisible(list->hasMatchedItems()); // remove title highlighting because it might // have been previously highlighted by less restrictive filter |