mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Don't add separate country field, use taxonomy
The more I looked at the code that added the country to the dive site, the more it seemed redundant given what we have with the taxonomy. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
de10fd4021
commit
21d78121ad
8 changed files with 21 additions and 24 deletions
|
|
@ -570,11 +570,14 @@ static inline struct dive_site *get_dive_site_for_dive(struct dive *dive)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static inline char *get_dive_country(struct dive *dive)
|
||||
static inline const char *get_dive_country(struct dive *dive)
|
||||
{
|
||||
struct dive_site *ds = get_dive_site_by_uuid(dive->dive_site_uuid);
|
||||
if (ds && ds->country)
|
||||
return ds->country;
|
||||
if (ds) {
|
||||
int idx = taxonomy_index_for_category(&ds->taxonomy, TC_COUNTRY);
|
||||
if (idx >= 0)
|
||||
return ds->taxonomy.category[idx].value;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue