summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-24 21:16:55 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-25 23:24:22 +0100
commitf7b1c762a97dc5c886eef9fe780c8172d819c72c (patch)
treeb66b437e3d8fa70a12e7275be67af63009fc1e88
parent66184d58e8bda6e0e962a6a419458a7fcde18dd0 (diff)
downloadsubsurface-f7b1c762a97dc5c886eef9fe780c8172d819c72c.tar.gz
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>
-rw-r--r--core/dive.h2
-rw-r--r--core/divelist.c1
2 files changed, 2 insertions, 1 deletions
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;