summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2013-04-19 16:51:44 -0700
committerMerov Linden <merov@lindenlab.com>2013-04-19 16:51:44 -0700
commit2cc1fb250f78df3a4b8f33b13b30defef7efb78a (patch)
tree3090305f95c8c564913579a407749544a7f712d2 /indra
parent03ad10d258095487d6ae8f26634932bc832f10df (diff)
CHUI-849 : Use a time limit for filtering instead of number limit, use a different limit for visible and unvisible lists
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/llfolderview.cpp18
-rw-r--r--indra/llui/llfolderviewmodel.cpp3
-rw-r--r--indra/llui/llfolderviewmodel.h8
-rw-r--r--indra/newview/app_settings/settings.xml24
-rwxr-xr-xindra/newview/llconversationmodel.h5
-rw-r--r--indra/newview/llfolderviewmodelinventory.cpp9
-rw-r--r--indra/newview/llinventoryfilter.cpp27
-rw-r--r--indra/newview/llinventoryfilter.h10
8 files changed, 22 insertions, 82 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index f3da71fc15..bf4d5ae1f9 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -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();
diff --git a/indra/llui/llfolderviewmodel.cpp b/indra/llui/llfolderviewmodel.cpp
index b5622756fe..3363dc5316 100644
--- a/indra/llui/llfolderviewmodel.cpp
+++ b/indra/llui/llfolderviewmodel.cpp
@@ -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());
}
diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h
index 64c00c782e..b1bcc8bbb4 100644
--- a/indra/llui/llfolderviewmodel.h
+++ b/indra/llui/llfolderviewmodel.h
@@ -87,18 +87,10 @@ public:
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
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index a28c6366c0..cd2b15ef2b 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -3391,27 +3391,27 @@
<key>Value</key>
<real>10.0</real>
</map>
- <key>FilterItemsPerFrame</key>
+ <key>FilterItemsMaxTimePerFrameVisible</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>
+ <key>Comment</key>
+ <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>10</integer>
</map>
- <key>FilterItemsMaxTimePerFrame</key>
+ <key>FilterItemsMaxTimePerFrameUnvisible</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 non 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>1</integer>
</map>
<key>FindLandArea</key>
<map>
diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h
index 5c942b1c40..d8cdcdfc97 100755
--- a/indra/newview/llconversationmodel.h
+++ b/indra/newview/llconversationmodel.h
@@ -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; }
diff --git a/indra/newview/llfolderviewmodelinventory.cpp b/indra/newview/llfolderviewmodelinventory.cpp
index ce957edcbd..4a51d26693 100644
--- a/indra/newview/llfolderviewmodelinventory.cpp
+++ b/indra/newview/llfolderviewmodelinventory.cpp
@@ -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();
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 3b712925e1..3c6974cf6d 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -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;
}
diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h
index 034fcf4a62..ce516af0b9 100644
--- a/indra/newview/llinventoryfilter.h
+++ b/indra/newview/llinventoryfilter.h
@@ -215,18 +215,10 @@ public:
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;