diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2017-11-22 19:22:02 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-11-25 08:13:42 -0800 |
commit | 806c7077f2abbf8978e3fefa95b1663a31a00503 (patch) | |
tree | 52825b1090de332e97f1a7f90ccb771f17f08212 /mobile-widgets/qmlmanager.cpp | |
parent | 64704d6e5a0865c5acb6ce40cc32ba929f41ba00 (diff) | |
download | subsurface-806c7077f2abbf8978e3fefa95b1663a31a00503.tar.gz |
mobile: get GPS data from dive site name
When the user entered a dive site using autocompletion, it
is a known site, of which we might have a GPS location already.
Just fill the known site coordinates.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 2c28ccf83..a3f1b5730 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -1536,6 +1536,18 @@ QString QMLManager::getVersion() const return versionRe.cap(1); } +QString QMLManager::getGpsFromSiteName(const QString& siteName) +{ uint32_t uuid; + struct dive_site *ds; + + uuid = get_dive_site_uuid_by_name(qPrintable(siteName), NULL); + if (uuid) { + ds = get_dive_site_by_uuid(uuid); + return QString(printGPSCoords(ds->latitude.udeg, ds->longitude.udeg)); + } + return ""; +} + QString QMLManager::notificationText() const { return m_notificationText; |