Merge pull request #71 from AyaneStorm/pr-inventory-limit-search-to-folders

Allows to limit search to folders only in inventory
master
Beq Janus 2025-02-06 22:37:36 +00:00 committed by GitHub
commit 056957becd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 52 additions and 5 deletions

View File

@ -702,17 +702,29 @@ bool LLInventoryFilter::checkAgainstSearchVisibility(const LLFolderViewModelItem
if (!object)
return true;
const bool is_link = object->getIsLinkType();
if (is_link && ((mFilterOps.mSearchVisibility & VISIBILITY_LINKS) == 0))
// <AS:chanayane> Short circuit search optimisation
//const bool is_link = object->getIsLinkType();
//if (is_link && ((mFilterOps.mSearchVisibility & VISIBILITY_LINKS) == 0))
if (((mFilterOps.mSearchVisibility & VISIBILITY_LINKS) == 0) && object->getIsLinkType())
// </AS:chanayane>
return false;
if (listener->isItemInOutfits() && ((mFilterOps.mSearchVisibility & VISIBILITY_OUTFITS) == 0))
// <AS:chanayane> Short circuit search optimisation
//if (listener->isItemInOutfits() && ((mFilterOps.mSearchVisibility & VISIBILITY_OUTFITS) == 0))
if (((mFilterOps.mSearchVisibility & VISIBILITY_OUTFITS) == 0) && listener->isItemInOutfits())
// </AS:chanayane>
return false;
if (listener->isItemInTrash() && ((mFilterOps.mSearchVisibility & VISIBILITY_TRASH) == 0))
// <AS:chanayane> Short circuit search optimisation
//if (listener->isItemInTrash() && ((mFilterOps.mSearchVisibility & VISIBILITY_TRASH) == 0))
if (((mFilterOps.mSearchVisibility & VISIBILITY_TRASH) == 0) && listener->isItemInTrash())
// </AS:chanayane>
return false;
if (!listener->isAgentInventory() && ((mFilterOps.mSearchVisibility & VISIBILITY_LIBRARY) == 0))
// <AS:chanayane> Short circuit search optimisation
//if (!listener->isAgentInventory() && ((mFilterOps.mSearchVisibility & VISIBILITY_LIBRARY) == 0))
if (((mFilterOps.mSearchVisibility & VISIBILITY_LIBRARY) == 0) && !listener->isAgentInventory())
// </AS:chanayane>
return false;
return true;
@ -1617,6 +1629,20 @@ const std::string& LLInventoryFilter::getFilterText()
filtered_by_all_types = false;
}
// <AS:chanayane> Search folders only
if (isFilterObjectTypesWith(LLInventoryType::IT_CATEGORY))
{
filtered_types += LLTrans::getString("Folders");
filtered_by_type = true;
num_filter_types++;
}
else
{
not_filtered_types += LLTrans::getString("Folders");
filtered_by_all_types = false;
}
// </AS:chanayane>
if (!LLInventoryModelBackgroundFetch::instance().folderFetchActive()
&& filtered_by_type
&& !filtered_by_all_types)

View File

@ -224,6 +224,9 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p)
mFilterMap["filter_type_snapshots"] = 0x01 << LLInventoryType::IT_SNAPSHOT;
mFilterMap["filter_type_settings"] = 0x01 << LLInventoryType::IT_SETTINGS;
mFilterMap["filter_type_materials"] = 0x01 << LLInventoryType::IT_MATERIAL;
// <AS:chanayane> Search folders only
mFilterMap["filter_type_folders"] = 0x01 << LLInventoryType::IT_CATEGORY;
// </AS:chanayane>
// initialize empty filter mask
mFilterMask = 0;

View File

@ -738,6 +738,9 @@
<combo_box.item value="filter_type_snapshots" label="Snapshots" />
<combo_box.item value="filter_type_materials" label="Materials" />
<combo_box.item value="filter_type_settings" label="Settings" />
<!-- [AS:Chanayane] Search folders only -->
<combo_box.item value="filter_type_folders" label="Folders" />
<!-- [/AS:Chanayane] -->
<combo_box.item value="filter_separator" label="------------" enabled="false" />
<combo_box.item value="filter_type_coalesced" label="Only Coalesced"/>
<combo_box.item value="filter_separator" label="------------" enabled="false" />

View File

@ -182,6 +182,9 @@
<combo_box.item value="filter_type_snapshots" label="Snapshots" />
<combo_box.item value="filter_type_materials" label="Materials" />
<combo_box.item value="filter_type_settings" label="Settings" />
<!-- [AS:Chanayane] Search folders only -->
<combo_box.item value="filter_type_folders" label="Folders" />
<!-- [/AS:Chanayane] -->
<combo_box.item value="filter_separator" label="------------" enabled="false" />
<combo_box.item value="filter_type_coalesced" label="Only Coalesced"/>
<combo_box.item value="filter_separator" label="------------" enabled="false" />

View File

@ -927,6 +927,9 @@ If you continue to receive this message, please contact Second Life support for
<string name="Textures" value=" Textures," />
<string name="Settings" value=" Settings," />
<string name="Snapshots" value=" Snapshots," />
<!-- [AS:Chanayane] Search folders only -->
<string name="Folders" value=" Folders," />
<!-- [/AS:Chanayane] -->
<string name="No Filters" value="No " />
<string name="Since Logoff" value=" - Since Logoff" />
<!-- <FS:Zi> FIRE-1175 - Filter Permissions Menu -->

View File

@ -181,6 +181,9 @@
<combo_box.item value="filter_type_snapshots" label="Snapshots" />
<combo_box.item value="filter_type_materials" label="Materials" />
<combo_box.item value="filter_type_settings" label="Settings" />
<!-- [AS:Chanayane] Search folders only -->
<combo_box.item value="filter_type_folders" label="Folders" />
<!-- [/AS:Chanayane] -->
<!-- <FS:minerjr> [FIRE-35042] Inventory - Only Coalesced Filter - More accessible -->
<combo_box.item value="filter_separator" label="------------" enabled="false" />
<!-- Add new custom filter to toggle Only Coalesced on and switch to filter_type_objects as only objects can be combined -->

View File

@ -183,6 +183,9 @@
<combo_box.item value="filter_type_snapshots" label="Snapshots" />
<combo_box.item value="filter_type_materials" label="Materials" />
<combo_box.item value="filter_type_settings" label="Settings" />
<!-- [AS:Chanayane] Search folders only -->
<combo_box.item value="filter_type_folders" label="Folders" />
<!-- [/AS:Chanayane] -->
<!-- <FS:minerjr> [FIRE-35042] Inventory - Only Coalesced Filter - More accessible -->
<combo_box.item value="filter_separator" label="------------" enabled="false" />
<!-- Add new custom filter to toggle Only Coalesced on and switch to filter_type_objects as only objects can be combined -->

View File

@ -786,6 +786,9 @@
<combo_box.item value="filter_type_snapshots" label="Snapshots" />
<combo_box.item value="filter_type_materials" label="Materials" />
<combo_box.item value="filter_type_settings" label="Settings" />
<!-- [AS:Chanayane] Search folders only -->
<combo_box.item value="filter_type_folders" label="Folders" />
<!-- [/AS:Chanayane] -->
<combo_box.item value="filter_separator" label="------------" enabled="false" />
<combo_box.item value="filter_type_coalesced" label="Only Coalesced"/>
<combo_box.item value="filter_separator" label="------------" enabled="false" />