From f7b1c762a97dc5c886eef9fe780c8172d819c72c Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 24 Oct 2018 21:16:55 +0100 Subject: core: add seperate number of dives shown to the trip structure We assume that any dive that gets added to a trip initially gets shown. The filter logic then needs to make sure it adjusts this number (which then makes it easy to tell the user how many dives of that trip are visible with the current filter). Signed-off-by: Dirk Hohndel --- core/dive.h | 2 +- core/divelist.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/dive.h b/core/dive.h index 4f62c3e31..8415974e9 100644 --- a/core/dive.h +++ b/core/dive.h @@ -292,7 +292,7 @@ typedef struct dive_trip char *location; char *notes; struct dive *dives; - int nrdives; + int nrdives, showndives; /* Used by the io-routines to mark trips that have already been written. */ bool saved; unsigned expanded : 1, selected : 1, autogen : 1, fixup : 1; diff --git a/core/divelist.c b/core/divelist.c index 88cf5645d..d1d326209 100644 --- a/core/divelist.c +++ b/core/divelist.c @@ -891,6 +891,7 @@ void add_dive_to_trip(struct dive *dive, dive_trip_t *trip) return; remove_dive_from_trip(dive, false); trip->nrdives++; + trip->showndives++; dive->divetrip = trip; dive->tripflag = ASSIGNED_TRIP; -- cgit v1.2.3-70-g09d2