summaryrefslogtreecommitdiff
path: root/indra/newview/llfolderviewitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfolderviewitem.cpp')
-rw-r--r--indra/newview/llfolderviewitem.cpp54
1 files changed, 36 insertions, 18 deletions
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index a1260d1156..63511301b3 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -38,12 +38,12 @@
#include "llfoldervieweventlistener.h"
#include "llinventorybridge.h" // for LLItemBridge in LLInventorySort::operator()
#include "llinventoryfilter.h"
+#include "llpanel.h"
#include "llviewercontrol.h" // gSavedSettings
#include "llviewerwindow.h" // Argh, only for setCursor()
// linden library includes
#include "llfocusmgr.h" // gFocusMgr
-#include "llpanel.h" // panel->hasFocus()
#include "lltrans.h"
///----------------------------------------------------------------------------
@@ -1290,9 +1290,10 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter)
// now query children
for (folders_t::iterator iter = mFolders.begin();
- iter != mFolders.end();)
+ iter != mFolders.end();
+ ++iter)
{
- folders_t::iterator fit = iter++;
+ LLFolderViewFolder* folder = (*iter);
// have we run out of iterations this frame?
if (filter.getFilterCount() < 0)
{
@@ -1302,15 +1303,15 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter)
// mMostFilteredDescendantGeneration might have been reset
// in which case we need to update it even for folders that
// don't need to be filtered anymore
- if ((*fit)->getCompletedFilterGeneration() >= filter_generation)
+ if (folder->getCompletedFilterGeneration() >= filter_generation)
{
// track latest generation to pass any child items
- if ((*fit)->getFiltered() || (*fit)->hasFilteredDescendants(filter.getMinRequiredGeneration()))
+ if (folder->getFiltered() || folder->hasFilteredDescendants(filter.getMinRequiredGeneration()))
{
mMostFilteredDescendantGeneration = filter_generation;
if (getRoot()->needsAutoSelect() && autoopen_folders)
{
- (*fit)->setOpenArrangeRecursively(TRUE);
+ folder->setOpenArrangeRecursively(TRUE);
}
}
// just skip it, it has already been filtered
@@ -1318,48 +1319,49 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter)
}
// update this folders filter status (and children)
- (*fit)->filter( filter );
+ folder->filter( filter );
// track latest generation to pass any child items
- if ((*fit)->getFiltered() || (*fit)->hasFilteredDescendants(filter_generation))
+ if (folder->getFiltered() || folder->hasFilteredDescendants(filter_generation))
{
mMostFilteredDescendantGeneration = filter_generation;
if (getRoot()->needsAutoSelect() && autoopen_folders)
{
- (*fit)->setOpenArrangeRecursively(TRUE);
+ folder->setOpenArrangeRecursively(TRUE);
}
}
}
for (items_t::iterator iter = mItems.begin();
- iter != mItems.end();)
+ iter != mItems.end();
+ ++iter)
{
- items_t::iterator iit = iter++;
+ LLFolderViewItem* item = (*iter);
if (filter.getFilterCount() < 0)
{
break;
}
- if ((*iit)->getLastFilterGeneration() >= filter_generation)
+ if (item->getLastFilterGeneration() >= filter_generation)
{
- if ((*iit)->getFiltered())
+ if (item->getFiltered())
{
mMostFilteredDescendantGeneration = filter_generation;
}
continue;
}
- if ((*iit)->getLastFilterGeneration() >= must_pass_generation &&
- !(*iit)->getFiltered(must_pass_generation))
+ if (item->getLastFilterGeneration() >= must_pass_generation &&
+ !item->getFiltered(must_pass_generation))
{
// failed to pass an earlier filter that was a subset of the current one
// go ahead and flag this item as done
- (*iit)->setFiltered(FALSE, filter_generation);
+ item->setFiltered(FALSE, filter_generation);
continue;
}
- (*iit)->filter( filter );
+ item->filter( filter );
- if ((*iit)->getFiltered(filter.getMinRequiredGeneration()))
+ if (item->getFiltered(filter.getMinRequiredGeneration()))
{
mMostFilteredDescendantGeneration = filter_generation;
}
@@ -2028,6 +2030,22 @@ void LLFolderViewFolder::openItem( void )
toggleOpen();
}
+void LLFolderViewFolder::applyFunctorToChildren(LLFolderViewFunctor& functor)
+{
+ for (folders_t::iterator iter = mFolders.begin();
+ iter != mFolders.end();)
+ {
+ folders_t::iterator fit = iter++;
+ functor.doItem((*fit));
+ }
+ for (items_t::iterator iter = mItems.begin();
+ iter != mItems.end();)
+ {
+ items_t::iterator iit = iter++;
+ functor.doItem((*iit));
+ }
+}
+
void LLFolderViewFolder::applyFunctorRecursively(LLFolderViewFunctor& functor)
{
functor.doFolder(this);