diff options
-rw-r--r-- | desktop-widgets/mapwidget.cpp | 8 | ||||
-rw-r--r-- | mobile-widgets/qmlmapwidgethelper.cpp | 12 | ||||
-rw-r--r-- | mobile-widgets/qmlmapwidgethelper.h | 4 |
3 files changed, 17 insertions, 7 deletions
diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp index 1646b7f51..fd461f4a6 100644 --- a/desktop-widgets/mapwidget.cpp +++ b/desktop-widgets/mapwidget.cpp @@ -23,13 +23,7 @@ MapWidget::MapWidget(QWidget *parent) : QQuickWidget(parent) void MapWidget::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;
-
- qDebug() << longitude << latitude;
+ m_mapHelper->centerOnDiveSite(ds);
}
void MapWidget::centerOnIndex(const QModelIndex& idx)
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;
+}
diff --git a/mobile-widgets/qmlmapwidgethelper.h b/mobile-widgets/qmlmapwidgethelper.h index f4bc05c7d..64ec2b75b 100644 --- a/mobile-widgets/qmlmapwidgethelper.h +++ b/mobile-widgets/qmlmapwidgethelper.h @@ -3,6 +3,8 @@ #include <QObject>
+struct dive_site;
+
class MapWidgetHelper : public QObject {
Q_OBJECT
@@ -11,6 +13,8 @@ class MapWidgetHelper : public QObject { public:
explicit MapWidgetHelper(QObject *parent = NULL);
+ void centerOnDiveSite(struct dive_site *);
+
private:
QObject *m_map;
};
|