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.cpp33
1 files changed, 20 insertions, 13 deletions
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index 5bef306485..135821f662 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -40,6 +40,7 @@
#include "llinventoryfilter.h"
#include "llpanel.h"
#include "llviewercontrol.h" // gSavedSettings
+#include "llviewerinventory.h"
#include "llviewerwindow.h" // Argh, only for setCursor()
// linden library includes
@@ -121,7 +122,7 @@ LLFolderViewItem::LLFolderViewItem(LLFolderViewItem::Params p)
mHasVisibleChildren(FALSE),
mIndentation(0),
mNumDescendantsSelected(0),
- mFiltered(FALSE),
+ mPassedFilter(FALSE),
mLastFilterGeneration(-1),
mStringMatchOffset(std::string::npos),
mControlLabelRotation(0.f),
@@ -223,17 +224,17 @@ BOOL LLFolderViewItem::potentiallyVisible()
BOOL LLFolderViewItem::getFiltered()
{
- return mFiltered && mLastFilterGeneration >= getRoot()->getFilter()->getMinRequiredGeneration();
+ return mPassedFilter && mLastFilterGeneration >= getRoot()->getFilter()->getMinRequiredGeneration();
}
BOOL LLFolderViewItem::getFiltered(S32 filter_generation)
{
- return mFiltered && mLastFilterGeneration >= filter_generation;
+ return mPassedFilter && mLastFilterGeneration >= filter_generation;
}
void LLFolderViewItem::setFiltered(BOOL filtered, S32 filter_generation)
{
- mFiltered = filtered;
+ mPassedFilter = filtered;
mLastFilterGeneration = filter_generation;
}
@@ -423,19 +424,20 @@ S32 LLFolderViewItem::getItemHeight()
void LLFolderViewItem::filter( LLInventoryFilter& filter)
{
- BOOL filtered = mListener && filter.check(this);
+ const BOOL previous_passed_filter = mPassedFilter;
+ const BOOL passed_filter = mListener && filter.check(this);
- // if our visibility will change as a result of this filter, then
+ // If our visibility will change as a result of this filter, then
// we need to be rearranged in our parent folder
- if (getVisible() != filtered)
+ if (mParentFolder)
{
- if (mParentFolder)
- {
+ if (getVisible() != passed_filter)
+ mParentFolder->requestArrange();
+ if (passed_filter != previous_passed_filter)
mParentFolder->requestArrange();
- }
}
- setFiltered(filtered, filter.getCurrentGeneration());
+ setFiltered(passed_filter, filter.getCurrentGeneration());
mStringMatchOffset = filter.getStringMatchOffset();
filter.decrementFilterCount();
@@ -603,6 +605,11 @@ const std::string& LLFolderViewItem::getSearchableLabel() const
return mSearchableLabel;
}
+LLViewerInventoryItem * LLFolderViewItem::getInventoryItem(void)
+{
+ return gInventory.getItem(getListener()->getUUID());
+}
+
std::string LLFolderViewItem::getName( void ) const
{
if(mListener)
@@ -1237,7 +1244,7 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter)
if (getLastFilterGeneration() < filter_generation)
{
if (getLastFilterGeneration() >= must_pass_generation && // folder has been compared to a valid precursor filter
- !mFiltered) // and did not pass the filter
+ !mPassedFilter) // and did not pass the filter
{
// go ahead and flag this folder as done
mLastFilterGeneration = filter_generation;
@@ -1375,7 +1382,7 @@ void LLFolderViewFolder::setFiltered(BOOL filtered, S32 filter_generation)
{
// if this folder is now filtered, but wasn't before
// (it just passed)
- if (filtered && !mFiltered)
+ if (filtered && !mPassedFilter)
{
// reset current height, because last time we drew it
// it might have had more visible items than now