Core: add unique id to trip

To make it easier to pass around trips through QML, give each trip
a unique id. The id is generated in alloc_trip() and uses the same
function to generate unique dive ids.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-09-14 19:26:34 +02:00 committed by Dirk Hohndel
parent 356293da7d
commit 067a481b78
2 changed files with 4 additions and 1 deletions

View file

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