summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mapwidget.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-05-09 21:33:01 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-05-11 12:06:19 -0700
commit44c65fec8855315d322b84b4c4207713b90328d3 (patch)
tree21ba6e6901fa5e46cebca4e7abadc33292e24d05 /desktop-widgets/mapwidget.cpp
parent30d96d37043684a4087f09b7171b1873ec140236 (diff)
downloadsubsurface-44c65fec8855315d322b84b4c4207713b90328d3.tar.gz
Map: automatically update names on the map
Currently, dive site names are only updated on full reload. Instead hook directly into the corresponding signal in the MapLocationModel to set the name. Also to the coordinates directly there instead of going via the MapWidgetHelper. In the MapWidgetHelper, just center on the changed dive site. Hook into the signal directly there and remove the slot from the MapWidget. This makes the whole call-chain at least one call shorter. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/mapwidget.cpp')
-rw-r--r--desktop-widgets/mapwidget.cpp8
1 files changed, 0 insertions, 8 deletions
diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp
index b28dea830..113283fc6 100644
--- a/desktop-widgets/mapwidget.cpp
+++ b/desktop-widgets/mapwidget.cpp
@@ -28,7 +28,6 @@ MapWidget::MapWidget(QWidget *parent) : QQuickWidget(parent)
m_mapHelper = nullptr;
setResizeMode(QQuickWidget::SizeRootObjectToView);
connect(this, &QQuickWidget::statusChanged, this, &MapWidget::doneLoading);
- connect(&diveListNotifier, &DiveListNotifier::diveSiteChanged, this, &MapWidget::diveSiteChanged);
connect(&diveListNotifier, &DiveListNotifier::divesChanged, this, &MapWidget::divesChanged);
setSource(urlMapWidget);
}
@@ -91,13 +90,6 @@ void MapWidget::coordinatesChanged(struct dive_site *ds, const location_t &locat
Command::editDiveSiteLocation(ds, location);
}
-void MapWidget::diveSiteChanged(struct dive_site *ds, int field)
-{
- CHECK_IS_READY_RETURN_VOID();
- if (field == LocationInformationModel::LOCATION)
- m_mapHelper->updateDiveSiteCoordinates(ds, ds->location);
-}
-
void MapWidget::divesChanged(dive_trip *, const QVector<dive *> &, DiveField field)
{
if (field == DiveField::DIVESITE)