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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2018-10-24 21:16:55 +01:00
parent 66184d58e8
commit f7b1c762a9
2 changed files with 2 additions and 1 deletions

View file

@ -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;

View file

@ -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;