summaryrefslogtreecommitdiff
path: root/indra/llui/llfolderviewmodel.h
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-12-09 15:42:51 -0800
committerRichard Linden <none@none>2013-12-09 15:42:51 -0800
commit813bc232e7175ba3e20a70f16427d12c7681a996 (patch)
treedd09169d99b95ba5e45b1c7e7b0b9fd5816728c4 /indra/llui/llfolderviewmodel.h
parent1a456c2e41905e93e393dc2dda0d143ee7611275 (diff)
MAINT-3017 FIX Inventory filter for Recent tab does not persist between sessions as it used to.
added names back to inventory filters, so they can be deserialized
Diffstat (limited to 'indra/llui/llfolderviewmodel.h')
-rwxr-xr-xindra/llui/llfolderviewmodel.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h
index b1bcc8bbb4..a909d13f97 100755
--- a/indra/llui/llfolderviewmodel.h
+++ b/indra/llui/llfolderviewmodel.h
@@ -386,27 +386,36 @@ template <typename SORT_TYPE, typename ITEM_TYPE, typename FOLDER_TYPE, typename
class LLFolderViewModel : public LLFolderViewModelCommon
{
public:
- LLFolderViewModel(){}
- virtual ~LLFolderViewModel() {}
-
typedef SORT_TYPE SortType;
typedef ITEM_TYPE ItemType;
typedef FOLDER_TYPE FolderType;
typedef FILTER_TYPE FilterType;
- virtual SortType& getSorter() { return mSorter; }
- virtual const SortType& getSorter() const { return mSorter; }
- virtual void setSorter(const SortType& sorter) { mSorter = sorter; requestSortAll(); }
+ LLFolderViewModel(SortType* sorter, FilterType* filter)
+ : mSorter(sorter),
+ mFilter(filter)
+ {}
- virtual FilterType& getFilter() { return mFilter; }
- virtual const FilterType& getFilter() const { return mFilter; }
- virtual void setFilter(const FilterType& filter) { mFilter = filter; }
+ virtual ~LLFolderViewModel()
+ {
+ delete mSorter;
+ mSorter = NULL;
+ delete mFilter;
+ mFilter = NULL;
+ }
+
+ virtual SortType& getSorter() { return *mSorter; }
+ virtual const SortType& getSorter() const { return *mSorter; }
+ virtual void setSorter(const SortType& sorter) { mSorter = new SortType(sorter); requestSortAll(); }
+
+ virtual FilterType& getFilter() { return *mFilter; }
+ virtual const FilterType& getFilter() const { return *mFilter; }
+ virtual void setFilter(const FilterType& filter) { mFilter = new FilterType(filter); }
// By default, we assume the content is available. If a network fetch mechanism is implemented for the model,
// this method needs to be overloaded and return the relevant fetch status.
virtual bool contentsReady() { return true; }
-
struct ViewModelCompare
{
ViewModelCompare(const SortType& sorter)
@@ -438,8 +447,8 @@ public:
}
protected:
- SortType mSorter;
- FilterType mFilter;
+ SortType* mSorter;
+ FilterType* mFilter;
};
#endif // LLFOLDERVIEWMODEL_H