diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-07-17 00:06:05 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-28 07:31:11 -0700 |
commit | 5cc2c02dfbace9e1486e60b8ffe58a136321e500 (patch) | |
tree | ba958822e5bbb64d6bbaef4538573167f162ff7a /mobile-widgets/qmlmapwidgethelper.cpp | |
parent | c68536ec56a1e0581cb25b6a9224f81547ad8460 (diff) | |
download | subsurface-5cc2c02dfbace9e1486e60b8ffe58a136321e500.tar.gz |
qmlmapwidgethelper: add the centerOnDiveSite() method
MapWidget sould not handle any of the map backend.
Instead it should just pass calls to MapWidgetHelper.
Do that for centerOnDiveSite().
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'mobile-widgets/qmlmapwidgethelper.cpp')
-rw-r--r-- | mobile-widgets/qmlmapwidgethelper.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmapwidgethelper.cpp b/mobile-widgets/qmlmapwidgethelper.cpp index 5e3016f89..d308afa40 100644 --- a/mobile-widgets/qmlmapwidgethelper.cpp +++ b/mobile-widgets/qmlmapwidgethelper.cpp @@ -1,6 +1,18 @@ #include <QDebug>
#include "qmlmapwidgethelper.h"
+#include "core/dive.h"
+#include "core/divesite.h"
+
MapWidgetHelper::MapWidgetHelper(QObject *parent) : QObject(parent)
{
}
+
+void MapWidgetHelper::centerOnDiveSite(struct dive_site *ds)
+{
+ if (!dive_site_has_gps_location(ds))
+ return;
+
+ qreal longitude = ds->longitude.udeg / 1000000.0;
+ qreal latitude = ds->latitude.udeg / 1000000.0;
+}
|