mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mapwidgethelper: add the reloadMapLocations() method
reloadMapLocations() is the method which is called when the list of markers (model) should be cleared and re-populated with new MapLocation objects. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
f44645b6fe
commit
ffb92111e5
2 changed files with 16 additions and 0 deletions
|
@ -23,3 +23,18 @@ void MapWidgetHelper::centerOnDiveSite(struct dive_site *ds)
|
||||||
Q_ARG(QVariant, latitude),
|
Q_ARG(QVariant, latitude),
|
||||||
Q_ARG(QVariant, longitude));
|
Q_ARG(QVariant, longitude));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MapWidgetHelper::reloadMapLocations()
|
||||||
|
{
|
||||||
|
struct dive_site *ds;
|
||||||
|
int idx;
|
||||||
|
m_mapLocationModel->clear();
|
||||||
|
|
||||||
|
for_each_dive_site(idx, ds) {
|
||||||
|
if (!dive_site_has_gps_location(ds))
|
||||||
|
continue;
|
||||||
|
const qreal longitude = ds->longitude.udeg / 1000000.0;
|
||||||
|
const qreal latitude = ds->latitude.udeg / 1000000.0;
|
||||||
|
m_mapLocationModel->add(new MapLocation(QGeoCoordinate(latitude, longitude)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ public:
|
||||||
explicit MapWidgetHelper(QObject *parent = NULL);
|
explicit MapWidgetHelper(QObject *parent = NULL);
|
||||||
|
|
||||||
void centerOnDiveSite(struct dive_site *);
|
void centerOnDiveSite(struct dive_site *);
|
||||||
|
void reloadMapLocations();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QObject *m_map;
|
QObject *m_map;
|
||||||
|
|
Loading…
Add table
Reference in a new issue