summaryrefslogtreecommitdiffstats
path: root/qt-models/maplocationmodel.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-05-08 22:15:01 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-05-11 12:06:19 -0700
commit0da86dfd8601edd33c47c787d42e4a687fff8aaf (patch)
tree3cb8c6b9acc358e17e1bb6e5b34c17b813f2bf7b /qt-models/maplocationmodel.h
parent0c387549164d7eec3ea6647c54ada2fba7f8d5e6 (diff)
downloadsubsurface-0da86dfd8601edd33c47c787d42e4a687fff8aaf.tar.gz
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>
Diffstat (limited to 'qt-models/maplocationmodel.h')
-rw-r--r--qt-models/maplocationmodel.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-models/maplocationmodel.h b/qt-models/maplocationmodel.h
index b1b13896a..404c76d4a 100644
--- a/qt-models/maplocationmodel.h
+++ b/qt-models/maplocationmodel.h
@@ -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);