Skip to content
Snippets Groups Projects
Commit 628e2863 authored by Mnikolenko Productengine's avatar Mnikolenko Productengine
Browse files

MAINT-7906 Inventory filter fix

parent 9a347914
No related branches found
No related tags found
No related merge requests found
......@@ -232,8 +232,9 @@ bool LLFolderViewModelItemInventory::filter( LLFolderViewFilter& filter)
return true;
}
*/
const bool passed_filter_folder = (getInventoryType() == LLInventoryType::IT_CATEGORY) ? filter.checkFolder(this) : true;
bool is_folder = (getInventoryType() == LLInventoryType::IT_CATEGORY);
const bool passed_filter_folder = is_folder ? filter.checkFolder(this) : true;
setPassedFolderFilter(passed_filter_folder, filter_generation);
bool continue_filtering = true;
......@@ -258,7 +259,7 @@ bool LLFolderViewModelItemInventory::filter( LLFolderViewFilter& filter)
{
// This is where filter check on the item done (CHUI-849)
const bool passed_filter = filter.check(this);
if (passed_filter && mChildren.empty()) // Update the latest filter generation for empty folders
if (passed_filter && mChildren.empty() && is_folder) // Update the latest filter generation for empty folders
{
LLFolderViewModelItemInventory* view_model = this;
while (view_model && view_model->mMostFilteredDescendantGeneration < filter_generation)
......
......@@ -495,6 +495,11 @@ void LLInventoryPanel::modelChanged(U32 mask)
view_item->refresh();
}
LLFolderViewFolder* parent = view_item->getParentFolder();
if(parent)
{
parent->getViewModelItem()->dirtyDescendantsFilter();
}
}
}
......
......@@ -29,7 +29,6 @@
#include "llagent.h"
#include "llagentcamera.h"
#include "llagentwearables.h"
#include "llavataractions.h"
#include "llcheckboxctrl.h"
#include "llcombobox.h"
......@@ -180,8 +179,6 @@ BOOL LLPanelMainInventory::postBuild()
mWornItemsPanel->setFilterLinks(LLInventoryFilter::FILTERLINK_EXCLUDE_LINKS);
mWornItemsPanel->getFilter().markDefault();
mWornItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mWornItemsPanel, _1, _2));
gAgentWearables.addLoadedCallback(boost::bind(&LLPanelMainInventory::updateWornItemsPanel, this));
}
mSearchTypeCombo = getChild<LLComboBox>("search_type");
if(mSearchTypeCombo)
......@@ -339,18 +336,6 @@ BOOL LLPanelMainInventory::handleKeyHere(KEY key, MASK mask)
}
void LLPanelMainInventory::updateWornItemsPanel()
{
if (!mUpdateWornTimer.getStarted())
{
mUpdateWornTimer.start();
}
else
{
mUpdateWornTimer.reset();
}
}
//----------------------------------------------------------------------------
// menu callbacks
......@@ -685,11 +670,6 @@ void LLPanelMainInventory::draw()
mActivePanel->setSortOrder(order);
mResortActivePanel = false;
}
if (mWornItemsPanel && mUpdateWornTimer.getStarted() && (mUpdateWornTimer.getElapsedTimeF32() > 1))
{
mUpdateWornTimer.stop();
mWornItemsPanel->getFilter().setModified(LLFolderViewFilter::FILTER_MORE_RESTRICTIVE);
}
LLPanel::draw();
updateItemcountText();
}
......
......@@ -112,8 +112,6 @@ class LLPanelMainInventory : public LLPanel, LLInventoryObserver
const std::string getFilterSubString();
void setFilterSubString(const std::string& string);
void updateWornItemsPanel();
// menu callbacks
void doToSelected(const LLSD& userdata);
void closeAllFolders();
......@@ -144,7 +142,6 @@ class LLPanelMainInventory : public LLPanel, LLInventoryObserver
S32 mItemCount;
std::string mItemCountString;
LLComboBox* mSearchTypeCombo;
LLFrameTimer mUpdateWornTimer;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment