diff options
| author | Richard Linden <none@none> | 2012-02-23 12:40:27 -0800 |
|---|---|---|
| committer | Richard Linden <none@none> | 2012-02-23 12:40:27 -0800 |
| commit | f4a122b6d72bdc2dc482fb04475703ffa5a00219 (patch) | |
| tree | 0155d0d080b42740666564ed9f02b9d33069a4e5 /indra/newview/llinventoryfilter.cpp | |
| parent | a5e4b15b7d29a64781eb32ef71e557a5bb8dc870 (diff) | |
| parent | 48bc2a7c9f6175a5c3179f6fccc98c3d3c50a4c9 (diff) | |
Automated merge with ssh://hg.lindenlab.com/richard/viewer-experience
Diffstat (limited to 'indra/newview/llinventoryfilter.cpp')
| -rw-r--r-- | indra/newview/llinventoryfilter.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 21d309707a..947f74315c 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -121,7 +121,29 @@ bool LLInventoryFilter::check(const LLInventoryItem* item) return passed; } -bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder) +bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder) const +{ + if (!folder) + { + llwarns << "The filter can not be checked on an invalid folder." << llendl; + llassert(false); // crash in development builds + return false; + } + + const LLFolderViewEventListener* listener = folder->getListener(); + if (!listener) + { + llwarns << "Folder view event listener not found." << llendl; + llassert(false); // crash in development builds + return false; + } + + const LLUUID folder_id = listener->getUUID(); + + return checkFolder(folder_id); +} + +bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const { // we're showing all folders, overriding filter if (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS) @@ -129,9 +151,6 @@ bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder) return true; } - const LLFolderViewEventListener* listener = folder->getListener(); - const LLUUID folder_id = listener->getUUID(); - if (mFilterOps.mFilterTypes & FILTERTYPE_CATEGORY) { // Can only filter categories for items in your inventory |
