diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-02-13 22:53:03 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-02-13 22:53:03 -0800 |
commit | 7ca3d859dc304674fe9e48c3ab3925303615a1c2 (patch) | |
tree | 56bda08fe3760acaf77c6bb0401d1818b01e10a0 /divesite.c | |
parent | cd77e2e700da92fe0292320d5d4a82361104adfe (diff) | |
download | subsurface-7ca3d859dc304674fe9e48c3ab3925303615a1c2.tar.gz |
Add helper function to detect empty dive sites
No point in keeping those.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'divesite.c')
-rw-r--r-- | divesite.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/divesite.c b/divesite.c index 492ba9d82..4f236017f 100644 --- a/divesite.c +++ b/divesite.c @@ -106,3 +106,13 @@ uint32_t create_dive_site_with_gps(const char *name, degrees_t latitude, degrees return ds->uuid; } + +/* a uuid is always present - but if all the other fields are empty, the dive site is pointless */ +bool dive_site_is_empty(struct dive_site *ds) +{ + return same_string(ds->name, "") && + same_string(ds->description, "") && + same_string(ds->notes, "") && + ds->latitude.udeg == 0 && + ds->longitude.udeg == 0; +} |