diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-02-26 22:26:11 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | f6e7bdc5ef99d5a5fe71ac4f32511900fa82e804 (patch) | |
tree | 398efefad3b84b33eb5e488bdfa5b2482f345cdd /core/uemis-downloader.c | |
parent | 36644dc9f7540886801bda6131dff36241d9e879 (diff) | |
download | subsurface-f6e7bdc5ef99d5a5fe71ac4f32511900fa82e804.tar.gz |
Dive site: add dive site table parameter to dive site functions
To enable undo of dive site functions, it is crucial to work
with different dive site tables. Therefore add a dive site table
parameter to dive site functions. For now, always pass the global
dive site table. Thus, this commit shouldn't alter any functionality.
After this change, a simple search for dive_site_table reveals all
places where the global dive site table is accessed.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/uemis-downloader.c')
-rw-r--r-- | core/uemis-downloader.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/uemis-downloader.c b/core/uemis-downloader.c index 930abbc18..36cac2c5a 100644 --- a/core/uemis-downloader.c +++ b/core/uemis-downloader.c @@ -993,7 +993,7 @@ static bool process_raw_buffer(device_data_t *devdata, uint32_t deviceid, char * } else if (!is_log && dive && !strcmp(tag, "divespot_id")) { int divespot_id = atoi(val); if (divespot_id != -1) { - struct dive_site *ds = create_dive_site("from Uemis", dive->when); + struct dive_site *ds = create_dive_site("from Uemis", dive->when, &dive_site_table); dive->dive_site = ds; uemis_mark_divelocation(dive->dc.diveid, divespot_id, ds); } @@ -1191,11 +1191,11 @@ static void get_uemis_divespot(const char *mountpath, int divespot_id, struct di * we search all existing divesites if we have one with the same name already. The function * returns the first found which is luckily not the newly created. */ - ods = get_dive_site_by_name(nds->name); + ods = get_dive_site_by_name(nds->name, &dive_site_table); if (ods) { /* if the uuid's are the same, the new site is a duplicate and can be deleted */ if (nds->uuid != ods->uuid) { - delete_dive_site(nds); + delete_dive_site(nds, &dive_site_table); dive->dive_site = ods; } } @@ -1204,7 +1204,7 @@ static void get_uemis_divespot(const char *mountpath, int divespot_id, struct di /* if we can't load the dive site details, delete the site we * created in process_raw_buffer */ - delete_dive_site(dive->dive_site); + delete_dive_site(dive->dive_site, &dive_site_table); } } } |