diff options
| author | Jonathan Yap <jhwelch@gmail.com> | 2014-06-07 05:16:56 -0400 |
|---|---|---|
| committer | Jonathan Yap <jhwelch@gmail.com> | 2014-06-07 05:16:56 -0400 |
| commit | 481f3cc54ba5ede6eadef77f1f808c39cb2cec92 (patch) | |
| tree | ecc0f3cf5f2a8783bd432caab6287f5163bb15c5 /indra/newview/llinventoryfilter.cpp | |
| parent | f759b3b9121621e14e766865198fb3ba8bdfd00c (diff) | |
STORM-2034 Add persistence for new setting, more XML formatting changes,
Fix two issues with how hours and days are calculated and displayed
Diffstat (limited to 'indra/newview/llinventoryfilter.cpp')
| -rwxr-xr-x | indra/newview/llinventoryfilter.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index c712e98bd5..a3b2dd3366 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -174,8 +174,6 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent const U32 filterTypes = mFilterOps.mFilterTypes; - const U32 FILTER_YOUNGER = 0; - //////////////////////////////////////////////////////////////////////////////// // FILTERTYPE_OBJECT // Pass if this item's type is of the correct filter type @@ -223,7 +221,7 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent earliest = 0; } - if (FILTER_YOUNGER == mFilterOps.mDateSearchDirection || isSinceLogoff()) + if (FILTERDATEDIRECTION_NEWER == mFilterOps.mDateSearchDirection || isSinceLogoff()) { if (listener->getCreationDate() < earliest || listener->getCreationDate() > mFilterOps.mMaxDate) @@ -641,8 +639,6 @@ void LLInventoryFilter::setHoursAgo(U32 hours) { if (mFilterOps.mHoursAgo != hours) { - const U32 FILTER_NEWER = 1; - bool are_date_limits_valid = mFilterOps.mMinDate == time_min() && mFilterOps.mMaxDate == time_max(); bool is_increasing = hours > mFilterOps.mHoursAgo; @@ -653,7 +649,7 @@ void LLInventoryFilter::setHoursAgo(U32 hours) BOOL more_restrictive = (are_date_limits_valid && (!is_increasing && hours) || is_increasing_from_zero); // Toggle for newer than search - if (FILTER_NEWER == mFilterOps.mDateSearchDirection) + if (FILTERDATEDIRECTION_NEWER == mFilterOps.mDateSearchDirection) { less_restrictive = !less_restrictive; more_restrictive = !more_restrictive; @@ -695,6 +691,11 @@ void LLInventoryFilter::setDateSearchDirection(U32 direction) } } +U32 LLInventoryFilter::getDateSearchDirection() const +{ + return mFilterOps.mDateSearchDirection; +} + void LLInventoryFilter::setFilterLinks(U64 filter_links) { if (mFilterOps.mFilterLinks != filter_links) @@ -959,6 +960,7 @@ LLInventoryFilter& LLInventoryFilter::operator=( const LLInventoryFilter& othe setFilterObjectTypes(other.getFilterObjectTypes()); setDateRange(other.getMinDate(), other.getMaxDate()); setHoursAgo(other.getHoursAgo()); + setDateSearchDirection(other.getDateSearchDirection()); setShowFolderState(other.getShowFolderState()); setFilterPermissions(other.getFilterPermissions()); setFilterSubString(other.getFilterSubString()); @@ -978,6 +980,7 @@ void LLInventoryFilter::toParams(Params& params) const params.filter_ops.date_range.min_date = getMinDate(); params.filter_ops.date_range.max_date = getMaxDate(); params.filter_ops.hours_ago = getHoursAgo(); + params.filter_ops.date_search_direction = getDateSearchDirection(); params.filter_ops.show_folder_state = getShowFolderState(); params.filter_ops.permissions = getFilterPermissions(); params.substring = getFilterSubString(); @@ -999,6 +1002,7 @@ void LLInventoryFilter::fromParams(const Params& params) } setDateRange(params.filter_ops.date_range.min_date, params.filter_ops.date_range.max_date); setHoursAgo(params.filter_ops.hours_ago); + setDateSearchDirection(params.filter_ops.date_search_direction); setShowFolderState(params.filter_ops.show_folder_state); setFilterPermissions(params.filter_ops.permissions); setFilterSubString(params.substring); |
