diff options
| author | Merov Linden <merov@lindenlab.com> | 2013-04-16 19:24:47 -0700 |
|---|---|---|
| committer | Merov Linden <merov@lindenlab.com> | 2013-04-16 19:24:47 -0700 |
| commit | e84c97e86d51b4f890695182c8087288481b6955 (patch) | |
| tree | d580d47e40ea313ff87a2d481d7d2b5e04ab4967 /indra/newview/llinventoryfilter.cpp | |
| parent | 0ecbbe9571be298284c2410ea441877b611bd875 (diff) | |
CHUI-912, CHUI-849 : Propagate arrange request correctly, limit sort, improve filter perf, clear traces, add comments.
Diffstat (limited to 'indra/newview/llinventoryfilter.cpp')
| -rw-r--r-- | indra/newview/llinventoryfilter.cpp | 26 |
1 files changed, 6 insertions, 20 deletions
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) { |
