From 4994d9d97d23afad234950f45a4ce99a276c5b5c Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Fri, 28 Mar 2014 18:22:03 +0200 Subject: MAINT-3878 FIXED Don't hide folder if it has descendants. --- indra/newview/llinventoryfilter.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventoryfilter.cpp') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 15463e0d33..b0d0cb217b 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -177,6 +177,7 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent // Pass if this item's type is of the correct filter type if (filterTypes & FILTERTYPE_OBJECT) { + // If it has no type, pass it, unless it's a link. if (object_type == LLInventoryType::IT_NONE) { @@ -244,13 +245,25 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent bool is_hidden_if_empty = LLViewerFolderType::lookupIsHiddenIfEmpty(listener->getPreferredType()); if (is_hidden_if_empty) { - // Force the fetching of those folders so they are hidden iff they really are empty... + // Force the fetching of those folders so they are hidden if they really are empty... gInventory.fetchDescendentsOf(object_id); - return FALSE; + + LLInventoryModel::cat_array_t* cat_array = NULL; + LLInventoryModel::item_array_t* item_array = NULL; + gInventory.getDirectDescendentsOf(object_id,cat_array,item_array); + S32 descendents_actual = 0; + if(cat_array && item_array) + { + descendents_actual = cat_array->count() + item_array->count(); + } + if (descendents_actual == 0) + { + return FALSE; + } } } } - + return TRUE; } -- cgit v1.2.3 From 331663458fbf0a434701b1bb1dd15901eb1c20fe Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 22 Apr 2014 19:27:25 +0300 Subject: MAINT-1344 FIXED Attempting to move a folder or item, to another folder in a different inventory window found via inventory search, fails. --- indra/newview/llinventoryfilter.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llinventoryfilter.cpp') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index c314886f16..b941552f21 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -985,6 +985,11 @@ void LLInventoryFilter::fromParams(const Params& params) setDateRangeLastLogoff(params.since_logoff); } +U64 LLInventoryFilter::getFilterTypes() const +{ + return mFilterOps.mFilterTypes; +} + U64 LLInventoryFilter::getFilterObjectTypes() const { return mFilterOps.mFilterObjectTypes; -- cgit v1.2.3 From 4da7f68549f531a6bec3643727cc68fb29a00bfa Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 5 Jun 2014 17:06:59 -0400 Subject: VWR-25689 Support 'older than' when inventory filtering --- indra/newview/llinventoryfilter.cpp | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventoryfilter.cpp') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 000eee3317..25447da53b 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -37,6 +37,7 @@ #include "llfolderview.h" #include "llinventorybridge.h" #include "llviewerfoldertype.h" +#include "llradiogroup.h" // linden library includes #include "llclipboard.h" @@ -51,6 +52,7 @@ LLInventoryFilter::FilterOps::FilterOps(const Params& p) mMinDate(p.date_range.min_date), mMaxDate(p.date_range.max_date), mHoursAgo(p.hours_ago), + mDateSearchDirection(p.date_search_direction), mShowFolderState(p.show_folder_state), mPermissions(p.permissions), mFilterTypes(p.types), @@ -209,6 +211,7 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent { const U16 HOURS_TO_SECONDS = 3600; time_t earliest = time_corrected() - mFilterOps.mHoursAgo * HOURS_TO_SECONDS; + if (mFilterOps.mMinDate > time_min() && mFilterOps.mMinDate < earliest) { earliest = mFilterOps.mMinDate; @@ -217,9 +220,20 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent { earliest = 0; } - if (listener->getCreationDate() < earliest || - listener->getCreationDate() > mFilterOps.mMaxDate) - return FALSE; + +llwarns << "DBG 3 " << mFilterOps.mDateSearchDirection << llendl; + if (1 == mFilterOps.mDateSearchDirection) + { + if (listener->getCreationDate() < earliest || + listener->getCreationDate() > mFilterOps.mMaxDate) + return FALSE; + } + else + { + if (listener->getCreationDate() > earliest || + listener->getCreationDate() > mFilterOps.mMaxDate) + return FALSE; + } } //////////////////////////////////////////////////////////////////////////////// @@ -635,6 +649,13 @@ 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) + { + less_restrictive = !less_restrictive; + more_restrictive = !more_restrictive; + } + mFilterOps.mHoursAgo = hours; mFilterOps.mMinDate = time_min(); mFilterOps.mMaxDate = time_max(); @@ -662,6 +683,16 @@ void LLInventoryFilter::setHoursAgo(U32 hours) } } +void LLInventoryFilter::setDateSearchDirection(U32 direction) +{ +llwarns << "DBG 2 " << direction << llendl; + if (direction != mFilterOps.mDateSearchDirection) + { + mFilterOps.mDateSearchDirection = direction; + setModified(FILTER_RESTART); + } +} + void LLInventoryFilter::setFilterLinks(U64 filter_links) { if (mFilterOps.mFilterLinks != filter_links) -- cgit v1.2.3 From 89837f385261804781979bdac499d264457e3297 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 6 Jun 2014 14:56:11 -0400 Subject: STOMR-2034 XML adjustments and a bit of code cleanup --- indra/newview/llinventoryfilter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventoryfilter.cpp') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 25447da53b..ce0f66edbb 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -174,6 +174,8 @@ 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 @@ -221,8 +223,7 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent earliest = 0; } -llwarns << "DBG 3 " << mFilterOps.mDateSearchDirection << llendl; - if (1 == mFilterOps.mDateSearchDirection) + if (FILTER_YOUNGER == mFilterOps.mDateSearchDirection) { if (listener->getCreationDate() < earliest || listener->getCreationDate() > mFilterOps.mMaxDate) @@ -685,7 +686,6 @@ void LLInventoryFilter::setHoursAgo(U32 hours) void LLInventoryFilter::setDateSearchDirection(U32 direction) { -llwarns << "DBG 2 " << direction << llendl; if (direction != mFilterOps.mDateSearchDirection) { mFilterOps.mDateSearchDirection = direction; -- cgit v1.2.3 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(-) (limited to 'indra/newview/llinventoryfilter.cpp') 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 From 481f3cc54ba5ede6eadef77f1f808c39cb2cec92 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sat, 7 Jun 2014 05:16:56 -0400 Subject: STORM-2034 Add persistence for new setting, more XML formatting changes, Fix two issues with how hours and days are calculated and displayed --- indra/newview/llinventoryfilter.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'indra/newview/llinventoryfilter.cpp') 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); -- cgit v1.2.3 From 51aa604af4e8b3b7361c31dcf2578c8a42bf3b1e Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 10 Jun 2014 13:06:53 -0400 Subject: STORM-2034 Try to fix incorrect logic about increasing and decreasing filtering. Minor XML adjustment. --- indra/newview/llinventoryfilter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llinventoryfilter.cpp') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index a3b2dd3366..1d788321b8 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -642,17 +642,17 @@ void LLInventoryFilter::setHoursAgo(U32 hours) bool are_date_limits_valid = mFilterOps.mMinDate == time_min() && mFilterOps.mMaxDate == time_max(); bool is_increasing = hours > mFilterOps.mHoursAgo; + bool is_decreasing = hours < mFilterOps.mHoursAgo; bool is_increasing_from_zero = is_increasing && !mFilterOps.mHoursAgo && !isSinceLogoff(); // *NOTE: need to cache last filter time, in case filter goes stale 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 newer than search - if (FILTERDATEDIRECTION_NEWER == mFilterOps.mDateSearchDirection) + if (FILTERDATEDIRECTION_OLDER == mFilterOps.mDateSearchDirection) { - less_restrictive = !less_restrictive; - more_restrictive = !more_restrictive; + less_restrictive = (are_date_limits_valid && ((is_decreasing && mFilterOps.mHoursAgo)) || !hours); + more_restrictive = (are_date_limits_valid && (!is_decreasing && hours) || is_increasing_from_zero); } mFilterOps.mHoursAgo = hours; -- cgit v1.2.3 From 078941c4a43289e35c9e8f0f566a6e55941592fb Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 10 Jun 2014 17:23:48 -0400 Subject: STORM-2034 Made small coding change per Oz's request --- indra/newview/llinventoryfilter.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'indra/newview/llinventoryfilter.cpp') diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 1d788321b8..0bbb4aeeff 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -646,10 +646,14 @@ void LLInventoryFilter::setHoursAgo(U32 hours) bool is_increasing_from_zero = is_increasing && !mFilterOps.mHoursAgo && !isSinceLogoff(); // *NOTE: need to cache last filter time, in case filter goes stale - 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); - - if (FILTERDATEDIRECTION_OLDER == mFilterOps.mDateSearchDirection) + BOOL less_restrictive; + BOOL more_restrictive; + if (FILTERDATEDIRECTION_NEWER == mFilterOps.mDateSearchDirection) + { + less_restrictive = (are_date_limits_valid && ((is_increasing && mFilterOps.mHoursAgo)) || !hours); + more_restrictive = (are_date_limits_valid && (!is_increasing && hours) || is_increasing_from_zero); + } + else { less_restrictive = (are_date_limits_valid && ((is_decreasing && mFilterOps.mHoursAgo)) || !hours); more_restrictive = (are_date_limits_valid && (!is_decreasing && hours) || is_increasing_from_zero); -- cgit v1.2.3