summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2014-08-12 19:45:53 +0300
committerandreykproductengine <akleshchev@productengine.com>2014-08-12 19:45:53 +0300
commita14ba78dbbfc925c94f1e8ed94b52bc08e626e3d (patch)
tree8c04ff9c334ce24f11d9f4c97c642a7427cdd1c6 /indra/llui
parentc64544afe9cfc8204137fc7a68f2d70e4830c056 (diff)
MAINT-4218 FIXED Adding clothing from inventory closes THAT clothing folder and hides THAT folder
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llfolderviewitem.cpp19
-rwxr-xr-xindra/llui/llfolderviewmodel.h11
2 files changed, 19 insertions, 11 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index d251544ee5..6ae03adcb9 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -258,20 +258,19 @@ BOOL LLFolderViewItem::passedFilter(S32 filter_generation)
BOOL LLFolderViewItem::isPotentiallyVisible(S32 filter_generation)
{
- // Item should be visible if:
- // 1. item passed current filter
- // 2. item was updated (gen < 0) but has descendants that passed filter
- // 3. item was recently updated and was visible before update
-
- LLFolderViewModelItem* model = getViewModelItem();
- if (model->getLastFilterGeneration() < 0 && !getFolderViewModel()->getFilter().isModified())
+ if (filter_generation < 0)
{
- return model->descendantsPassedFilter(filter_generation) || getVisible();
+ filter_generation = getFolderViewModel()->getFilter().getFirstSuccessGeneration();
}
- else
+ LLFolderViewModelItem* model = getViewModelItem();
+ BOOL visible = model->passedFilter(filter_generation);
+ if (model->getMarkedDirtyGeneration() >= filter_generation)
{
- return model->passedFilter(filter_generation);
+ // unsure visibility state
+ // retaining previous visibility until item is updated or filter generation changes
+ visible |= getVisible();
}
+ return visible;
}
void LLFolderViewItem::refresh()
diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h
index 8d98363c5f..cad3ca9d8d 100755
--- a/indra/llui/llfolderviewmodel.h
+++ b/indra/llui/llfolderviewmodel.h
@@ -190,6 +190,7 @@ public:
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 +231,7 @@ public:
mFolderViewItem(NULL),
mLastFilterGeneration(-1),
mLastFolderFilterGeneration(-1),
+ mMarkedDirtyGeneration(-1),
mMostFilteredDescendantGeneration(-1),
mParent(NULL),
mRootViewModel(root_view_model)
@@ -243,8 +245,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;
@@ -303,6 +310,7 @@ public:
mLastFilterGeneration = filter_generation;
mStringMatchOffsetFilter = string_offset;
mStringFilterSize = string_size;
+ mMarkedDirtyGeneration = -1;
}
void setPassedFolderFilter(bool passed, S32 filter_generation)
@@ -351,7 +359,8 @@ protected:
S32 mLastFilterGeneration,
mLastFolderFilterGeneration,
- mMostFilteredDescendantGeneration;
+ mMostFilteredDescendantGeneration,
+ mMarkedDirtyGeneration;
child_list_t mChildren;
LLFolderViewModelItem* mParent;