summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfilter.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2020-09-24 19:06:58 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2020-09-24 19:06:58 +0300
commit3c381458525c234137ea4a51916d16291fdfd237 (patch)
tree3d135a12a575d6758d081a436a7e5301406f29f5 /indra/newview/llinventoryfilter.cpp
parent7ae4f766f03fa9046c30ee868697e7ec637b6ad0 (diff)
SL-14001 New Inventory search visibility options should persist from login to login
Diffstat (limited to 'indra/newview/llinventoryfilter.cpp')
-rw-r--r--indra/newview/llinventoryfilter.cpp42
1 files changed, 41 insertions, 1 deletions
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 1b99c90d5c..2e0037aa57 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -64,7 +64,7 @@ LLInventoryFilter::FilterOps::FilterOps(const Params& p)
mFilterTypes(p.types),
mFilterUUID(p.uuid),
mFilterLinks(p.links),
- mSearchVisibility(0xffffFFFFffffFFFFULL)
+ mSearchVisibility(p.search_visibility)
{
}
@@ -907,6 +907,44 @@ void LLInventoryFilter::setFilterSubString(const std::string& string)
}
}
+void LLInventoryFilter::setSearchVisibilityTypes(U32 types)
+{
+ if (mFilterOps.mSearchVisibility != types)
+ {
+ // keep current items only if no perm bits getting turned off
+ BOOL fewer_bits_set = (mFilterOps.mSearchVisibility & ~types);
+ BOOL more_bits_set = (~mFilterOps.mSearchVisibility & types);
+ mFilterOps.mSearchVisibility = types;
+
+ if (more_bits_set && fewer_bits_set)
+ {
+ setModified(FILTER_RESTART);
+ }
+ else if (more_bits_set)
+ {
+ // target must have all requested permission bits, so more bits == more restrictive
+ setModified(FILTER_MORE_RESTRICTIVE);
+ }
+ else if (fewer_bits_set)
+ {
+ setModified(FILTER_LESS_RESTRICTIVE);
+ }
+ }
+}
+
+void LLInventoryFilter::setSearchVisibilityTypes(const Params& params)
+{
+ if (!params.validateBlock())
+ {
+ return;
+ }
+
+ if (params.filter_ops.search_visibility.isProvided())
+ {
+ setSearchVisibilityTypes(params.filter_ops.search_visibility);
+ }
+}
+
void LLInventoryFilter::setFilterPermissions(PermissionMask perms)
{
if (mFilterOps.mPermissions != perms)
@@ -1375,6 +1413,7 @@ void LLInventoryFilter::toParams(Params& params) const
params.filter_ops.show_folder_state = getShowFolderState();
params.filter_ops.creator_type = getFilterCreatorType();
params.filter_ops.permissions = getFilterPermissions();
+ params.filter_ops.search_visibility = getSearchVisibilityTypes();
params.substring = getFilterSubString();
params.since_logoff = isSinceLogoff();
}
@@ -1398,6 +1437,7 @@ void LLInventoryFilter::fromParams(const Params& params)
setShowFolderState(params.filter_ops.show_folder_state);
setFilterCreator(params.filter_ops.creator_type);
setFilterPermissions(params.filter_ops.permissions);
+ setSearchVisibilityTypes(params.filter_ops.search_visibility);
setFilterSubString(params.substring);
setDateRangeLastLogoff(params.since_logoff);
}