mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix dive site creation from v2 git storage
Clearly didn't test that part well enough. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a6336d13b3
commit
0ce215e0d9
3 changed files with 30 additions and 8 deletions
14
divesite.c
14
divesite.c
|
|
@ -67,3 +67,17 @@ uint32_t dive_site_uuid_by_name(const char *name)
|
|||
|
||||
return id;
|
||||
}
|
||||
|
||||
/* if the uuid is valid, just get the site, otherwise create it first;
|
||||
* so you can call this with dive->dive_site_uuid and you'll either get the existing
|
||||
* dive site or it will create a new one - so make sure you assign the uuid back to
|
||||
* dive->dive_site_uuid when using this function! */
|
||||
struct dive_site *get_or_create_dive_site_by_uuid(uint32_t uuid)
|
||||
{
|
||||
struct dive_site *ds = get_dive_site_by_uuid(uuid);
|
||||
|
||||
if (!ds)
|
||||
ds = alloc_dive_site();
|
||||
|
||||
return ds;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue