From 6e916b6764c7779776240db6f48f8d4435c2745c Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Sat, 15 Jul 2017 23:52:59 +0300 Subject: locationinformationwidget: abstract between GlobeGPS and MapWidget Connect the same signals for the two classes based on the NO_MARBLE macro. Signed-off-by: Lubomir I. Ivanov --- desktop-widgets/locationinformation.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp index 74f659593..80676b36f 100644 --- a/desktop-widgets/locationinformation.cpp +++ b/desktop-widgets/locationinformation.cpp @@ -5,6 +5,7 @@ #include "desktop-widgets/divelistview.h" #include "core/qthelper.h" #include "desktop-widgets/globe.h" +#include "desktop-widgets/mapwidget.h" #include "qt-models/filtermodels.h" #include "qt-models/divelocationmodel.h" #include "core/divesitehelpers.h" @@ -43,8 +44,8 @@ LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBo ui.diveSiteListView->setModel(filter_model); ui.diveSiteListView->setModelColumn(LocationInformationModel::NAME); ui.diveSiteListView->installEventFilter(this); + // Map Management Code. #ifndef NO_MARBLE - // Globe Management Code. connect(this, &LocationInformationWidget::requestCoordinates, GlobeGPS::instance(), &GlobeGPS::prepareForGetDiveCoordinates); connect(this, &LocationInformationWidget::endRequestCoordinates, @@ -53,6 +54,15 @@ LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBo this, &LocationInformationWidget::updateGpsCoordinates); connect(this, &LocationInformationWidget::endEditDiveSite, GlobeGPS::instance(), &GlobeGPS::repopulateLabels); +#else + connect(this, &LocationInformationWidget::requestCoordinates, + MapWidget::instance(), &MapWidget::prepareForGetDiveCoordinates); + connect(this, &LocationInformationWidget::endRequestCoordinates, + MapWidget::instance(), &MapWidget::endGetDiveCoordinates); + connect(MapWidget::instance(), &MapWidget::coordinatesChanged, + this, &LocationInformationWidget::updateGpsCoordinates); + connect(this, &LocationInformationWidget::endEditDiveSite, + MapWidget::instance(), &MapWidget::repopulateLabels); #endif } -- cgit v1.2.3-70-g09d2