Map: reload on selection change directly

When changing the dive selection, we have to reload the map to show
the correctly highlighted flags. Do this directly by hooking into
the DiveListNotifier::divesChanged signal instead of indirectly
via the MainTab.

Moreover, on reload center on the highlighted dive sites.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-05-03 12:10:19 +02:00 committed by Dirk Hohndel
parent 48b8129137
commit d4a91a52fa
5 changed files with 12 additions and 12 deletions

View file

@ -3,6 +3,7 @@
#define MAPWIDGET_H
#include "core/units.h"
#include "core/subsurface-qt/DiveListNotifier.h"
#include <QQuickWidget>
#include <QList>
@ -11,7 +12,6 @@
class QResizeEvent;
class QQuickItem;
class MapWidgetHelper;
struct dive_site;
class MapWidget : public QQuickWidget {
@ -35,6 +35,7 @@ public slots:
void coordinatesChanged(struct dive_site *ds, const location_t &);
void doneLoading(QQuickWidget::Status status);
void diveSiteChanged(struct dive_site *ds, int field);
void divesChanged(dive_trip *, const QVector<dive *> &, DiveField field);
private:
static MapWidget *m_instance;