From f759b3b9121621e14e766865198fb3ba8bdfd00c Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 6 Jun 2014 16:23:20 -0400 Subject: STORM-2034 Add a constant, try to fix some datetime logic filtering errors --- indra/newview/llinventoryfilter.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index ce0f66edbb..c712e98bd5 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -223,7 +223,7 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent earliest = 0; } - if (FILTER_YOUNGER == mFilterOps.mDateSearchDirection) + if (FILTER_YOUNGER == mFilterOps.mDateSearchDirection || isSinceLogoff()) { if (listener->getCreationDate() < earliest || listener->getCreationDate() > mFilterOps.mMaxDate) @@ -641,6 +641,8 @@ 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; @@ -650,8 +652,8 @@ void LLInventoryFilter::setHoursAgo(U32 hours) BOOL less_restrictive = (are_date_limits_valid && ((is_increasing && mFilterOps.mHoursAgo)) || !hours); BOOL more_restrictive = (are_date_limits_valid && (!is_increasing && hours) || is_increasing_from_zero); - // Toggle for older than search - if (0 == mFilterOps.mDateSearchDirection) + // Toggle for newer than search + if (FILTER_NEWER == mFilterOps.mDateSearchDirection) { less_restrictive = !less_restrictive; more_restrictive = !more_restrictive; -- cgit v1.2.3