diff --git a/core/trip.c b/core/trip.c index bc9b1b5a9..c4534fe27 100644 --- a/core/trip.c +++ b/core/trip.c @@ -122,7 +122,9 @@ void remove_dive_from_trip(struct dive *dive, struct trip_table *trip_table_arg) dive_trip_t *alloc_trip(void) { - return calloc(1, sizeof(dive_trip_t)); + dive_trip_t *res = calloc(1, sizeof(dive_trip_t)); + res->id = dive_getUniqID(); + return res; } /* insert the trip into the trip table */ diff --git a/core/trip.h b/core/trip.h index 2ca2791cd..51f371589 100644 --- a/core/trip.h +++ b/core/trip.h @@ -13,6 +13,7 @@ typedef struct dive_trip char *location; char *notes; struct dive_table dives; + int id; /* unique ID for this trip: used to pass trips through QML. */ /* Used by the io-routines to mark trips that have already been written. */ bool saved; bool autogen;