diff options
author | Graham Linden <none@none> | 2014-07-31 08:40:57 -0700 |
---|---|---|
committer | Graham Linden <none@none> | 2014-07-31 08:40:57 -0700 |
commit | db43a0560c259623a1a8022668f8482d82cae9c8 (patch) | |
tree | 31e532720212ed1697897d6c2694fe991cb8f812 /indra/newview/llinventorybridge.cpp | |
parent | 76e7f978c157f9921593ea0e43f642cb9de4703d (diff) | |
parent | 532433674c9553636af9ea8d433b9da6d6fae587 (diff) |
Merge viewer-release
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rwxr-xr-x | indra/newview/llinventorybridge.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 5df28ccb73..87335cd5e6 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4593,6 +4593,10 @@ public: virtual void changed(U32 mask) { mBridgep->refreshFolderViewItem(); + if (mask & LLFriendObserver::ONLINE) + { + mBridgep->checkSearchBySuffixChanges(); + } } protected: LLCallingCardBridge* mBridgep; @@ -4627,6 +4631,44 @@ void LLCallingCardBridge::refreshFolderViewItem() } } +void LLCallingCardBridge::checkSearchBySuffixChanges() +{ + if (!mDisplayName.empty()) + { + // changes in mDisplayName are processed by rename function and here it will be always same + // suffixes are also of fixed length, and we are processing change of one at a time, + // so it should be safe to use length (note: mSearchableName is capitalized) + S32 old_length = mSearchableName.length(); + S32 new_length = mDisplayName.length() + getLabelSuffix().length(); + if (old_length == new_length) + { + return; + } + mSearchableName.assign(mDisplayName); + mSearchableName.append(getLabelSuffix()); + LLStringUtil::toUpper(mSearchableName); + if (new_length<old_length) + { + LLInventoryFilter* filter = getInventoryFilter(); + if (filter && mPassedFilter && mSearchableName.find(filter->getFilterSubString()) == std::string::npos) + { + // string no longer contains substring + // we either have to update all parents manually or restart filter. + // dirtyFilter will not work here due to obsolete descendants' generations + getInventoryFilter()->setModified(LLFolderViewFilter::FILTER_MORE_RESTRICTIVE); + } + } + else + { + if (getInventoryFilter()) + { + // mSearchableName became longer, we gained additional suffix and need to repeat filter check. + dirtyFilter(); + } + } + } +} + // virtual void LLCallingCardBridge::performAction(LLInventoryModel* model, std::string action) { |