diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-04-20 14:42:25 +0300 |
---|---|---|
committer | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-04-20 14:42:25 +0300 |
commit | a03f3cd00db95fb8dc6fd500e95054c654088bf7 (patch) | |
tree | 6326033f45bb32962dda62d6e0af2e59e249b3d8 /indra | |
parent | 1b88a4e5f9f5b19e887c7dac90c88032b18f5728 (diff) |
SL-19630 FIXED Adding a thumbnail to item in combination view does not update gallery view
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llinventorygallery.cpp | 34 | ||||
-rw-r--r-- | indra/newview/llinventorygallery.h | 1 |
2 files changed, 23 insertions, 12 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index b4a23f7c55..a078d6c81d 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -594,18 +594,24 @@ void LLInventoryGallery::setFilterSubString(const std::string& string) void LLInventoryGallery::applyFilter(LLInventoryGalleryItem* item, const std::string& filter_substring) { - if (!item) return; + if(item) + { + item->setHidden(!checkAgainstFilters(item, filter_substring)); + } +} + +bool LLInventoryGallery::checkAgainstFilters(LLInventoryGalleryItem* item, const std::string& filter_substring) +{ + if (!item) return false; if (item->isFolder() && (mFilter->getShowFolderState() == LLInventoryFilter::SHOW_ALL_FOLDERS)) { - item->setHidden(false); - return; + return true; } if(item->isLink() && ((mFilter->getSearchVisibilityTypes() & LLInventoryFilter::VISIBILITY_LINKS) == 0) && !filter_substring.empty()) { - item->setHidden(true); - return; + return false; } bool hidden = false; @@ -620,20 +626,17 @@ void LLInventoryGallery::applyFilter(LLInventoryGalleryItem* item, const std::st } if(hidden) { - item->setHidden(true); - return; + return false; } if(!mFilter->checkAgainstFilterThumbnails(item->getUUID())) { - item->setHidden(true); - return; + return false; } if(!checkAgainstFilterType(item->getUUID())) { - item->setHidden(true); - return; + return false; } std::string desc; @@ -660,7 +663,7 @@ void LLInventoryGallery::applyFilter(LLInventoryGalleryItem* item, const std::st LLStringUtil::toUpper(cur_filter); hidden = (std::string::npos == desc.find(cur_filter)); - item->setHidden(hidden); + return !hidden; } void LLInventoryGallery::setSearchType(LLInventoryFilter::ESearchType type) @@ -803,6 +806,13 @@ void LLInventoryGallery::updateItemThumbnail(LLUUID item_id) if (mItemMap[item_id]) { mItemMap[item_id]->setThumbnail(thumbnail_id); + + bool passes_filter = checkAgainstFilters(mItemMap[item_id], mFilterSubString); + if((mItemMap[item_id]->isHidden() && passes_filter) + || (!mItemMap[item_id]->isHidden() && !passes_filter)) + { + reArrangeRows(); + } } } diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h index 07613b20aa..1760535524 100644 --- a/indra/newview/llinventorygallery.h +++ b/indra/newview/llinventorygallery.h @@ -134,6 +134,7 @@ protected: void showContextMenu(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& item_id); void applyFilter(LLInventoryGalleryItem* item, const std::string& filter_substring); + bool checkAgainstFilters(LLInventoryGalleryItem* item, const std::string& filter_substring); LLInventoryCategoriesObserver* mCategoriesObserver; LLThumbnailsObserver* mThumbnailsObserver; |