From 0b318540318ffa62318f0d9b74c2b14306bd0d97 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 11 Nov 2014 22:59:04 -0800 Subject: Deselect dives that are no longer shown as the dive list is filtered This cleans up the way we ensure that all dives are handled as the dive list is filtered. Signed-off-by: Dirk Hohndel --- divelist.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'divelist.c') diff --git a/divelist.c b/divelist.c index ad0c2e716..8802aaea1 100644 --- a/divelist.c +++ b/divelist.c @@ -873,6 +873,16 @@ void select_dives_in_trip(struct dive_trip *trip) select_dive(get_divenr(dive)); } +void filter_dive(struct dive *d, bool shown) +{ + if (!d) + return; + d->hidden_by_filter = !shown; + if (!shown && d->selected) + deselect_dive(get_divenr(d)); +} + + /* This only gets called with non-NULL trips. * It does not combine notes or location, just picks the first one * (or the second one if the first one is empty */ -- cgit v1.2.3-70-g09d2