Map: in edit mode place no-gps dive sites at center of map

Move the code to add the first selected dive site from
MapWidgetHelper::enterEditMode() to MapLocationModel::reload().

Thus, the list of sites is built only at one place. For this
it is necessary to pass a pointer to the map, so that new
dive sites can be added at the center of the map.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-05-08 22:15:01 +02:00 committed by Dirk Hohndel
parent 0c38754916
commit 0da86dfd86
3 changed files with 17 additions and 17 deletions

View file

@ -60,7 +60,8 @@ public:
int rowCount(const QModelIndex &parent) const override;
int count();
void add(MapLocation *);
void reload();
// If map is not null, it will be used to place new dive sites without GPS location at the center of the map
void reload(QObject *map);
MapLocation *getMapLocation(const struct dive_site *ds);
const QVector<dive_site *> &selectedDs() const;
void updateMapLocationCoordinates(const struct dive_site *ds, QGeoCoordinate coord);