mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
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:
parent
356293da7d
commit
067a481b78
2 changed files with 4 additions and 1 deletions
|
@ -122,7 +122,9 @@ void remove_dive_from_trip(struct dive *dive, struct trip_table *trip_table_arg)
|
||||||
|
|
||||||
dive_trip_t *alloc_trip(void)
|
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 */
|
/* insert the trip into the trip table */
|
||||||
|
|
|
@ -13,6 +13,7 @@ typedef struct dive_trip
|
||||||
char *location;
|
char *location;
|
||||||
char *notes;
|
char *notes;
|
||||||
struct dive_table dives;
|
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. */
|
/* Used by the io-routines to mark trips that have already been written. */
|
||||||
bool saved;
|
bool saved;
|
||||||
bool autogen;
|
bool autogen;
|
||||||
|
|
Loading…
Reference in a new issue