summaryrefslogtreecommitdiffstats
path: root/subsurface-core/qthelper.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-26 13:19:43 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-26 13:33:10 -0800
commit7ffe7a8c8a389fd56cba3c18d142bf1ad59d872c (patch)
treefeaf6857c2c633ea7c733306a4cc8cc8265173cf /subsurface-core/qthelper.cpp
parent07a0ef213993b1dd04ace8ff3d8720a499570764 (diff)
downloadsubsurface-7ffe7a8c8a389fd56cba3c18d142bf1ad59d872c.tar.gz
Dive list model: add GPS string access
If the QML UI needs the GPS information, we need a way to get to it. I'm not convinced that having it as comma separated string is the best way to go, but that's what I need for the Google API so that's what I picked for now. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core/qthelper.cpp')
-rw-r--r--subsurface-core/qthelper.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/subsurface-core/qthelper.cpp b/subsurface-core/qthelper.cpp
index d55e8438f..25d5b4233 100644
--- a/subsurface-core/qthelper.cpp
+++ b/subsurface-core/qthelper.cpp
@@ -80,6 +80,10 @@ QString Dive::location() const
return m_location;
}
+QString Dive::gps() const
+{
+ return m_gps;
+}
QString Dive::duration() const
{
return m_duration;
@@ -222,6 +226,15 @@ void Dive::put_location()
}
}
+void Dive::put_gps()
+{
+ struct dive_site *ds = get_dive_site_by_uuid(dive->dive_site_uuid);
+ if (ds)
+ m_gps = QString("%1,%2").arg(ds->latitude.udeg / 1000000.0).arg(ds->longitude.udeg / 1000000.0);
+ else
+ m_gps = QString();
+}
+
void Dive::put_depth()
{
m_depth = get_depth_string(dive->dc.maxdepth.mm, true, true);