summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorypanel.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-02-08 14:52:24 -0500
committerLoren Shih <seraph@lindenlab.com>2010-02-08 14:52:24 -0500
commit7e1932878563e5847335d5dcb66c9b23232c372c (patch)
treeaa8466ca37fc75ca714d11570064d8a69f0b3d10 /indra/newview/llinventorypanel.cpp
parent295843ee3616ae01eae359f81d3ac2f468e780dd (diff)
EXT-4846 : [NUX] Inventory Side Panel - Can we suppress the "Landmarks" and "My FavoriteS" folder since they have their own Task Panel?
Adding simple infrastructure for supporting ability to hide folder types from inventory panels, but NOT exercising this code. This will be deferred for 2.1. Also did some very superficial header file cleanup for LLInventoryPanel.
Diffstat (limited to 'indra/newview/llinventorypanel.cpp')
-rw-r--r--indra/newview/llinventorypanel.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index a6d63e58f5..467255d1a7 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -522,6 +522,11 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id)
{
folderp->setHidden(TRUE);
}
+ const LLViewerInventoryCategory *cat = dynamic_cast<LLViewerInventoryCategory *>(objectp);
+ if (cat && getIsHiddenFolderType(cat->getPreferredType()))
+ {
+ folderp->setHidden(TRUE);
+ }
}
}
else
@@ -553,6 +558,12 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id)
if (itemp)
{
itemp->addToFolder(parent_folder, mFolders);
+
+ // Don't add children of hidden folders unless this is the panel's root folder.
+ if (itemp->getHidden() && (id != mStartFolderID))
+ {
+ return;
+ }
}
}
@@ -954,3 +965,16 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)
return NULL;
}
+
+void LLInventoryPanel::addHideFolderType(LLFolderType::EType folder_type)
+{
+ if (!getIsHiddenFolderType(folder_type))
+ {
+ mHiddenFolderTypes.push_back(folder_type);
+ }
+}
+
+BOOL LLInventoryPanel::getIsHiddenFolderType(LLFolderType::EType folder_type) const
+{
+ return (std::find(mHiddenFolderTypes.begin(), mHiddenFolderTypes.end(), folder_type) != mHiddenFolderTypes.end());
+}