aboutsummaryrefslogtreecommitdiffstats
path: root/dive.h
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2013-01-16 12:31:09 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-16 13:04:31 -0800
commit30d090cee2903edc949253cd0a4b7de15f094029 (patch)
tree1f491c3917df39dde3c30ac5fa411c521e91242f /dive.h
parente9953fa5e6985045c599eec6d63572ee7bb458d7 (diff)
downloadsubsurface-30d090cee2903edc949253cd0a4b7de15f094029.tar.gz
Only offer to show dive on map if we have location information
This adds the "Show in map" menu entry to the divelist only if we actually have a location to show. Of course, having some way to visually see whether we have a GPS location even before we show the menu would probably be good. Maybe a marker in the "location" string or something. But in the meanwhile, at least we don't have that menu entry if we have nothing to show. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.h')
-rw-r--r--dive.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/dive.h b/dive.h
index 1cb0613ee..2c8f18b94 100644
--- a/dive.h
+++ b/dive.h
@@ -342,6 +342,11 @@ struct dive {
struct divecomputer dc;
};
+static inline int dive_has_location(struct dive *dive)
+{
+ return dive->latitude.udeg || dive->longitude.udeg;
+}
+
/* Pa = N/m^2 - so we determine the weight (in N) of the mass of 10m
* of water (and use standard salt water at 1.03kg per liter if we don't know salinity)
* and add that to the surface pressure (or to 1013 if that's unknown) */