CHUI-849 : Use a time limit for filtering instead of number limit, use a different limit for visible and unvisible lists
parent
03ad10d258
commit
2cc1fb250f
|
|
@ -325,19 +325,10 @@ void LLFolderView::filter( LLFolderViewFilter& filter )
|
|||
{
|
||||
// Entry point of inventory filtering (CHUI-849)
|
||||
LLFastTimer t2(FTM_FILTER);
|
||||
//filter.setFilterCount(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsPerFrame"), 1, 5000));
|
||||
filter.resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsMaxTimePerFrame"), 1, 1000));
|
||||
filter.resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32(mParentPanel->getVisible() ? "FilterItemsMaxTimePerFrameVisible" : "FilterItemsMaxTimePerFrameUnvisible"), 1, 100));
|
||||
|
||||
// Note: we filter the model, not the view
|
||||
getViewModelItem()->filter(filter);
|
||||
// Test the filter state
|
||||
if (filter.isTimedOut())
|
||||
{
|
||||
llinfos << "Merov : filter of " << mParentPanel->getName() << " not finished, count = " << filter.getFilterCount() << llendl;
|
||||
}
|
||||
else if (filter.getFilterCount() != 0)
|
||||
{
|
||||
llinfos << "Merov : last filter of " << mParentPanel->getName() << " done! count = " << filter.getFilterCount() << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent)
|
||||
|
|
@ -1622,9 +1613,8 @@ void LLFolderView::update()
|
|||
// Filter to determine visibility before arranging
|
||||
filter(getFolderViewModel()->getFilter());
|
||||
|
||||
// Clear the modified setting on the filter only if the filter count is non-zero after running the filter process
|
||||
// Note: if the filter count is zero, that means the filter exhausted its count per frame and halted before completing the entire set of items
|
||||
//if (getFolderViewModel()->getFilter().isModified() && (getFolderViewModel()->getFilter().getFilterCount() > 0))
|
||||
// Clear the modified setting on the filter only if the filter finished after running the filter process
|
||||
// Note: if the filter count has timed out, that means the filter halted before completing the entire set of items
|
||||
if (getFolderViewModel()->getFilter().isModified() && (!getFolderViewModel()->getFilter().isTimedOut()))
|
||||
{
|
||||
getFolderViewModel()->getFilter().clearModified();
|
||||
|
|
|
|||
|
|
@ -48,8 +48,7 @@ std::string LLFolderViewModelCommon::getStatusText()
|
|||
|
||||
void LLFolderViewModelCommon::filter()
|
||||
{
|
||||
//getFilter().setFilterCount(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsPerFrame"), 1, 5000));
|
||||
getFilter().resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsMaxTimePerFrame"), 1, 1000));
|
||||
getFilter().resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsMaxTimePerFrameVisible"), 1, 100));
|
||||
mFolderView->getViewModelItem()->filter(getFilter());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,19 +86,11 @@ public:
|
|||
//RN: this is public to allow system to externally force a global refilter
|
||||
virtual void setModified(EFilterModified behavior = FILTER_RESTART) = 0;
|
||||
|
||||
// +-------------------------------------------------------------------+
|
||||
// + Count
|
||||
// +-------------------------------------------------------------------+
|
||||
virtual void setFilterCount(S32 count) = 0;
|
||||
virtual S32 getFilterCount() const = 0;
|
||||
virtual void decrementFilterCount() = 0;
|
||||
|
||||
// +-------------------------------------------------------------------+
|
||||
// + Time
|
||||
// +-------------------------------------------------------------------+
|
||||
virtual void resetTime(S32 timeout) = 0;
|
||||
virtual bool isTimedOut() = 0;
|
||||
virtual void incrementFilterCount() = 0; // Temp!
|
||||
|
||||
// +-------------------------------------------------------------------+
|
||||
// + Default
|
||||
|
|
|
|||
|
|
@ -3391,27 +3391,27 @@
|
|||
<key>Value</key>
|
||||
<real>10.0</real>
|
||||
</map>
|
||||
<key>FilterItemsPerFrame</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Maximum number of inventory items to match against search filter every frame (lower to increase framerate while searching, higher to improve search speed)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>S32</string>
|
||||
<key>Value</key>
|
||||
<integer>500</integer>
|
||||
</map>
|
||||
<key>FilterItemsMaxTimePerFrame</key>
|
||||
<key>FilterItemsMaxTimePerFrameVisible</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Max time devoted to items filtering per frame (in milliseconds)</string>
|
||||
<string>Max time devoted to items filtering per frame for visible inventory listings (in milliseconds)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>S32</string>
|
||||
<key>Value</key>
|
||||
<integer>100</integer>
|
||||
<integer>10</integer>
|
||||
</map>
|
||||
<key>FilterItemsMaxTimePerFrameUnvisible</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Max time devoted to items filtering per frame for non visible inventory listings (in milliseconds)</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>S32</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>FindLandArea</key>
|
||||
<map>
|
||||
|
|
|
|||
|
|
@ -252,14 +252,9 @@ public:
|
|||
const std::string& getName() const { return mEmpty; }
|
||||
const std::string& getFilterText() { return mEmpty; }
|
||||
void setModified(EFilterModified behavior = FILTER_RESTART) { }
|
||||
|
||||
void setFilterCount(S32 count) { }
|
||||
S32 getFilterCount() const { return 0; }
|
||||
void decrementFilterCount() { }
|
||||
|
||||
void resetTime(S32 timeout) { }
|
||||
bool isTimedOut() { return false; }
|
||||
void incrementFilterCount() { } // Temp!
|
||||
|
||||
bool isDefault() const { return true; }
|
||||
bool isNotDefault() const { return false; }
|
||||
|
|
|
|||
|
|
@ -191,6 +191,7 @@ bool LLFolderViewModelItemInventory::filter( LLFolderViewFilter& filter)
|
|||
return true;
|
||||
}
|
||||
|
||||
// *TODO : Revise the logic for fast pass on less restrictive filter case
|
||||
/*
|
||||
const S32 sufficient_pass_generation = filter.getFirstSuccessGeneration();
|
||||
if (getLastFilterGeneration() >= sufficient_pass_generation
|
||||
|
|
@ -218,7 +219,6 @@ bool LLFolderViewModelItemInventory::filter( LLFolderViewFilter& filter)
|
|||
for (child_list_t::iterator iter = mChildren.begin(), end_iter = mChildren.end(); iter != end_iter; ++iter)
|
||||
{
|
||||
continue_filtering = filterChildItem((*iter), filter);
|
||||
//if (filter.getFilterCount() <= 0)
|
||||
if (!continue_filtering)
|
||||
{
|
||||
break;
|
||||
|
|
@ -226,13 +226,10 @@ bool LLFolderViewModelItemInventory::filter( LLFolderViewFilter& filter)
|
|||
}
|
||||
}
|
||||
|
||||
// If we didn't use all filter iterations that means we filtered all of our descendants so filter ourselves now
|
||||
//if (filter.getFilterCount() > 0)
|
||||
// If we didn't use all the filter time that means we filtered all of our descendants so we can filter ourselves now
|
||||
if (continue_filtering)
|
||||
{
|
||||
// This is where filter count is hit and filter check on the item done (CHUI-849)
|
||||
//filter.decrementFilterCount();
|
||||
filter.incrementFilterCount(); // Temp
|
||||
// This is where filter check on the item done (CHUI-849)
|
||||
const bool passed_filter = filter.check(this);
|
||||
setPassedFilter(passed_filter, filter_generation, filter.getStringMatchOffset(this), filter.getFilterStringSize());
|
||||
continue_filtering = !filter.isTimedOut();
|
||||
|
|
|
|||
|
|
@ -70,8 +70,7 @@ LLInventoryFilter::LLInventoryFilter(const Params& p)
|
|||
mFilterSubString(p.substring),
|
||||
mCurrentGeneration(0),
|
||||
mFirstRequiredGeneration(0),
|
||||
mFirstSuccessGeneration(0),
|
||||
mFilterCount(0)
|
||||
mFirstSuccessGeneration(0)
|
||||
{
|
||||
// copy mFilterOps into mDefaultFilterOps
|
||||
markDefault();
|
||||
|
|
@ -1012,25 +1011,6 @@ LLInventoryFilter::EFolderShow LLInventoryFilter::getShowFolderState() const
|
|||
return mFilterOps.mShowFolderState;
|
||||
}
|
||||
|
||||
void LLInventoryFilter::setFilterCount(S32 count)
|
||||
{
|
||||
mFilterCount = count;
|
||||
}
|
||||
S32 LLInventoryFilter::getFilterCount() const
|
||||
{
|
||||
return mFilterCount;
|
||||
}
|
||||
|
||||
void LLInventoryFilter::decrementFilterCount()
|
||||
{
|
||||
mFilterCount--;
|
||||
}
|
||||
|
||||
void LLInventoryFilter::incrementFilterCount()
|
||||
{
|
||||
mFilterCount++;
|
||||
}
|
||||
|
||||
bool LLInventoryFilter::isTimedOut()
|
||||
{
|
||||
return mFilterTime.hasExpired();
|
||||
|
|
@ -1038,15 +1018,12 @@ bool LLInventoryFilter::isTimedOut()
|
|||
|
||||
void LLInventoryFilter::resetTime(S32 timeout)
|
||||
{
|
||||
mFilterCount = 0;
|
||||
mFilterTime.reset();
|
||||
F32 time_in_sec = (F32)(timeout)/1000.0;
|
||||
mFilterTime.setTimerExpirySec(time_in_sec);
|
||||
}
|
||||
|
||||
|
||||
|
||||
S32 LLInventoryFilter::getCurrentGeneration() const
|
||||
S32 LLInventoryFilter::getCurrentGeneration() const
|
||||
{
|
||||
return mCurrentGeneration;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -214,19 +214,11 @@ public:
|
|||
//RN: this is public to allow system to externally force a global refilter
|
||||
void setModified(EFilterModified behavior = FILTER_RESTART);
|
||||
|
||||
// +-------------------------------------------------------------------+
|
||||
// + Count
|
||||
// +-------------------------------------------------------------------+
|
||||
void setFilterCount(S32 count);
|
||||
S32 getFilterCount() const;
|
||||
void decrementFilterCount();
|
||||
|
||||
// +-------------------------------------------------------------------+
|
||||
// + Time
|
||||
// +-------------------------------------------------------------------+
|
||||
void resetTime(S32 timeout);
|
||||
bool isTimedOut();
|
||||
void incrementFilterCount(); // Temp!
|
||||
|
||||
// +-------------------------------------------------------------------+
|
||||
// + Default
|
||||
|
|
@ -275,9 +267,7 @@ private:
|
|||
S32 mFirstRequiredGeneration;
|
||||
S32 mFirstSuccessGeneration;
|
||||
|
||||
S32 mFilterCount;
|
||||
EFilterModified mFilterModified;
|
||||
|
||||
LLTimer mFilterTime;
|
||||
|
||||
std::string mFilterText;
|
||||
|
|
|
|||
Loading…
Reference in New Issue