summaryrefslogtreecommitdiff
path: root/indra/llui/llfolderviewmodel.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llfolderviewmodel.h')
-rwxr-xr-xindra/llui/llfolderviewmodel.h26
1 files changed, 23 insertions, 3 deletions
diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h
index 8d98363c5f..f6550eae42 100755
--- a/indra/llui/llfolderviewmodel.h
+++ b/indra/llui/llfolderviewmodel.h
@@ -185,11 +185,13 @@ public:
virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) = 0;
virtual void setPassedFolderFilter(bool passed, S32 filter_generation) = 0;
virtual void dirtyFilter() = 0;
+ virtual void dirtyDescendantsFilter() = 0;
virtual bool hasFilterStringMatch() = 0;
virtual std::string::size_type getFilterStringOffset() = 0;
virtual std::string::size_type getFilterStringSize() = 0;
virtual S32 getLastFilterGeneration() const = 0;
+ virtual S32 getMarkedDirtyGeneration() const = 0;
virtual bool hasChildren() const = 0;
virtual void addChild(LLFolderViewModelItem* child) = 0;
@@ -230,6 +232,7 @@ public:
mFolderViewItem(NULL),
mLastFilterGeneration(-1),
mLastFolderFilterGeneration(-1),
+ mMarkedDirtyGeneration(-1),
mMostFilteredDescendantGeneration(-1),
mParent(NULL),
mRootViewModel(root_view_model)
@@ -243,8 +246,13 @@ public:
S32 getLastFilterGeneration() const { return mLastFilterGeneration; }
S32 getLastFolderFilterGeneration() const { return mLastFolderFilterGeneration; }
+ S32 getMarkedDirtyGeneration() const { return mMarkedDirtyGeneration; }
void dirtyFilter()
{
+ if(mMarkedDirtyGeneration < 0)
+ {
+ mMarkedDirtyGeneration = mLastFilterGeneration;
+ }
mLastFilterGeneration = -1;
mLastFolderFilterGeneration = -1;
@@ -254,6 +262,14 @@ public:
mParent->dirtyFilter();
}
}
+ void dirtyDescendantsFilter()
+ {
+ mMostFilteredDescendantGeneration = -1;
+ if (mParent)
+ {
+ mParent->dirtyDescendantsFilter();
+ }
+ }
bool hasFilterStringMatch();
std::string::size_type getFilterStringOffset();
std::string::size_type getFilterStringSize();
@@ -272,7 +288,7 @@ public:
return;
}
}
- mChildren.push_back(child);
+ mChildren.push_back(child);
child->setParent(this);
dirtyFilter();
requestSort();
@@ -280,7 +296,8 @@ public:
virtual void removeChild(LLFolderViewModelItem* child)
{
mChildren.remove(child);
- child->setParent(NULL);
+ child->setParent(NULL);
+ dirtyDescendantsFilter();
dirtyFilter();
}
@@ -290,6 +307,7 @@ public:
// This is different and not equivalent to calling removeChild() on each child
std::for_each(mChildren.begin(), mChildren.end(), DeletePointer());
mChildren.clear();
+ dirtyDescendantsFilter();
dirtyFilter();
}
@@ -303,6 +321,7 @@ public:
mLastFilterGeneration = filter_generation;
mStringMatchOffsetFilter = string_offset;
mStringFilterSize = string_size;
+ mMarkedDirtyGeneration = -1;
}
void setPassedFolderFilter(bool passed, S32 filter_generation)
@@ -351,7 +370,8 @@ protected:
S32 mLastFilterGeneration,
mLastFolderFilterGeneration,
- mMostFilteredDescendantGeneration;
+ mMostFilteredDescendantGeneration,
+ mMarkedDirtyGeneration;
child_list_t mChildren;
LLFolderViewModelItem* mParent;