diff options
Diffstat (limited to 'indra/newview/llpersonmodelcommon.cpp')
-rw-r--r-- | indra/newview/llpersonmodelcommon.cpp | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/indra/newview/llpersonmodelcommon.cpp b/indra/newview/llpersonmodelcommon.cpp index 91c3f6a92a..3e9ca9c3b9 100644 --- a/indra/newview/llpersonmodelcommon.cpp +++ b/indra/newview/llpersonmodelcommon.cpp @@ -170,8 +170,9 @@ LLUUID LLPersonModel::getAgentID() // LLPersonViewFilter::LLPersonViewFilter() : - mEmpty(""), + mEmptyLookupMessage(""), mFilterSubString(""), + mName(""), mFilterModified(FILTER_NONE) { } @@ -184,31 +185,32 @@ void LLPersonViewFilter::setFilterSubString(const std::string& string) if (mFilterSubString != filter_sub_string_new) { + // *TODO : Add logic to support more and less restrictive filtering + mFilterModified = FILTER_RESTART; mFilterSubString = filter_sub_string_new; } } -std::string::size_type LLPersonViewFilter::getFilterStringSize() const +bool LLPersonViewFilter::showAllResults() const { - return mFilterSubString.size(); + return mFilterSubString.size() > 0; } bool LLPersonViewFilter::check(const LLFolderViewModelItem* item) { - //const LLPersonModelCommon* person = dynamic_cast<const LLPersonModelCommon*>(item); std::string::size_type string_offset = mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; return (mFilterSubString.size() == 0 || string_offset != std::string::npos); } -bool LLPersonViewFilter::showAllResults() const +std::string::size_type LLPersonViewFilter::getStringMatchOffset(LLFolderViewModelItem* item) const { - return mFilterSubString.size() > 0; + return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; } -std::string::size_type LLPersonViewFilter::getStringMatchOffset(LLFolderViewModelItem* item) const +std::string::size_type LLPersonViewFilter::getFilterStringSize() const { - return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; + return mFilterSubString.size(); } bool LLPersonViewFilter::isActive() const @@ -218,11 +220,21 @@ bool LLPersonViewFilter::isActive() const bool LLPersonViewFilter::isModified() const { - return isActive(); + return mFilterModified != FILTER_NONE; } void LLPersonViewFilter::clearModified() { mFilterModified = FILTER_NONE; - setFilterSubString(""); } + +void LLPersonViewFilter::setEmptyLookupMessage(const std::string& message) +{ + mEmptyLookupMessage = message; +} + +std::string LLPersonViewFilter::getEmptyLookupMessage() const +{ + return mEmptyLookupMessage; +} + |