From d533a33f4229244405ed0b247fce410513b6c3e9 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 8 Apr 2013 18:59:21 -0700 Subject: CHUI-912 : WIP : Add traces to various aspects of the inventory filtering, sorting and arranging (to be deleted) --- indra/newview/llinventoryfilter.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview/llinventoryfilter.cpp') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 92f2d33073..eef0adda52 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -100,6 +100,15 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item) passed = passed && checkAgainstFilterLinks(listener); passed = passed && passed_clipboard; + if (listener->getSearchableName() == "A NOUNOURS") + { + llinfos << "Merov : LLInventoryFilter::check : Here we go with our special NOUNOURS case, checked for string '" << mFilterSubString << "', passed = " << passed << ", name = " << listener->getSearchableName() << llendl; + } + else + { + llinfos << "Merov : LLInventoryFilter::check : checked for string '" << mFilterSubString << "', passed = " << passed << ", name = " << listener->getSearchableName() << llendl; + } + return passed; } -- cgit v1.2.3 From 0ecbbe9571be298284c2410ea441877b611bd875 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 15 Apr 2013 11:16:57 -0700 Subject: CHUI-912 : WIP : Try to change the return value of filter() so to trigger arrange on the fly. --- indra/newview/llinventoryfilter.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra/newview/llinventoryfilter.cpp') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index eef0adda52..d3f5d68708 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -104,10 +104,6 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item) { llinfos << "Merov : LLInventoryFilter::check : Here we go with our special NOUNOURS case, checked for string '" << mFilterSubString << "', passed = " << passed << ", name = " << listener->getSearchableName() << llendl; } - else - { - llinfos << "Merov : LLInventoryFilter::check : checked for string '" << mFilterSubString << "', passed = " << passed << ", name = " << listener->getSearchableName() << llendl; - } return passed; } -- cgit v1.2.3 From e84c97e86d51b4f890695182c8087288481b6955 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 16 Apr 2013 19:24:47 -0700 Subject: CHUI-912, CHUI-849 : Propagate arrange request correctly, limit sort, improve filter perf, clear traces, add comments. --- indra/newview/llinventoryfilter.cpp | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'indra/newview/llinventoryfilter.cpp') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index d3f5d68708..b0c75cb176 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -73,8 +73,6 @@ LLInventoryFilter::LLInventoryFilter(const Params& p) mFirstSuccessGeneration(0), mFilterCount(0) { - mNextFilterGeneration = mCurrentGeneration + 1; - // copy mFilterOps into mDefaultFilterOps markDefault(); } @@ -92,35 +90,23 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item) return passed_clipboard; } - std::string::size_type string_offset = mFilterSubString.size() ? listener->getSearchableName().find(mFilterSubString) : std::string::npos; - - BOOL passed = (mFilterSubString.size() == 0 || string_offset != std::string::npos); + bool passed = (mFilterSubString.size() ? listener->getSearchableName().find(mFilterSubString) != std::string::npos : true); passed = passed && checkAgainstFilterType(listener); passed = passed && checkAgainstPermissions(listener); passed = passed && checkAgainstFilterLinks(listener); passed = passed && passed_clipboard; - if (listener->getSearchableName() == "A NOUNOURS") - { - llinfos << "Merov : LLInventoryFilter::check : Here we go with our special NOUNOURS case, checked for string '" << mFilterSubString << "', passed = " << passed << ", name = " << listener->getSearchableName() << llendl; - } - return passed; } bool LLInventoryFilter::check(const LLInventoryItem* item) { - std::string::size_type string_offset = mFilterSubString.size() ? item->getName().find(mFilterSubString) : std::string::npos; - + const bool passed_string = (mFilterSubString.size() ? item->getName().find(mFilterSubString) != std::string::npos : true); const bool passed_filtertype = checkAgainstFilterType(item); const bool passed_permissions = checkAgainstPermissions(item); - const BOOL passed_clipboard = checkAgainstClipboard(item->getUUID()); - const bool passed = (passed_filtertype - && passed_permissions - && passed_clipboard - && (mFilterSubString.size() == 0 || string_offset != std::string::npos)); + const bool passed_clipboard = checkAgainstClipboard(item->getUUID()); - return passed; + return passed_filtertype && passed_permissions && passed_clipboard && passed_string; } bool LLInventoryFilter::checkFolder(const LLFolderViewModelItem* item) const @@ -444,7 +430,7 @@ void LLInventoryFilter::updateFilterTypes(U64 types, U64& current_types) current_types = types; if (more_bits_set && fewer_bits_set) { - // neither less or more restrive, both simultaneously + // neither less or more restrictive, both simultaneously // so we need to filter from scratch setModified(FILTER_RESTART); } @@ -719,7 +705,7 @@ void LLInventoryFilter::resetDefault() void LLInventoryFilter::setModified(EFilterModified behavior) { mFilterText.clear(); - mCurrentGeneration = mNextFilterGeneration++; + mCurrentGeneration++; if (mFilterModified == FILTER_NONE) { -- cgit v1.2.3 From 03ad10d258095487d6ae8f26634932bc832f10df Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 18 Apr 2013 19:46:08 -0700 Subject: CHUI-849 : WIP : Filter limit on time instead of number of items --- indra/newview/llinventoryfilter.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'indra/newview/llinventoryfilter.cpp') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index b0c75cb176..3b712925e1 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -1026,6 +1026,26 @@ void LLInventoryFilter::decrementFilterCount() mFilterCount--; } +void LLInventoryFilter::incrementFilterCount() +{ + mFilterCount++; +} + +bool LLInventoryFilter::isTimedOut() +{ + return mFilterTime.hasExpired(); +} + +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 { return mCurrentGeneration; -- cgit v1.2.3 From 2cc1fb250f78df3a4b8f33b13b30defef7efb78a Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 19 Apr 2013 16:51:44 -0700 Subject: CHUI-849 : Use a time limit for filtering instead of number limit, use a different limit for visible and unvisible lists --- indra/newview/llinventoryfilter.cpp | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'indra/newview/llinventoryfilter.cpp') 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; } -- cgit v1.2.3