mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Merge branch 'tomaz'
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
commit
9d622996ba
12 changed files with 208 additions and 266 deletions
16
divesite.c
16
divesite.c
|
|
@ -200,3 +200,19 @@ void clear_dive_site(struct dive_site *ds)
|
|||
ds->taxonomy.nr = 0;
|
||||
free_taxonomy(&ds->taxonomy);
|
||||
}
|
||||
|
||||
uint32_t find_or_create_dive_site_with_name(const char *name)
|
||||
{
|
||||
int i;
|
||||
struct dive_site *ds;
|
||||
bool found = false;
|
||||
for_each_dive_site(i,ds) {
|
||||
if (same_string(name, ds->name)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ds)
|
||||
return ds->uuid;
|
||||
return create_dive_site(name);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue