mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Map: don't access displayed_dive_site in reloadMapLocations()
MapWidgetHelper::reloadMapLocations() reloads all dive flags of the non-hidden dives plus the one of the currently edited dive. Use the current_dive macro to determine whether this is the current dive site instead of the global displayed_dive_site object. This is part of a series of commits, which makes the map-code independent of the global displayed_dive_site object. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
dd44dc4ab8
commit
ac02854a8a
1 changed files with 4 additions and 10 deletions
|
@ -125,19 +125,13 @@ void MapWidgetHelper::reloadMapLocations()
|
||||||
QVector<uint32_t> locationUuids;
|
QVector<uint32_t> locationUuids;
|
||||||
qreal latitude, longitude;
|
qreal latitude, longitude;
|
||||||
|
|
||||||
if (displayed_dive_site.uuid && dive_site_has_gps_location(&displayed_dive_site)) {
|
|
||||||
latitude = displayed_dive_site.latitude.udeg * 0.000001;
|
|
||||||
longitude = displayed_dive_site.longitude.udeg * 0.000001;
|
|
||||||
location = new MapLocation(displayed_dive_site.uuid, QGeoCoordinate(latitude, longitude),
|
|
||||||
QString(displayed_dive_site.name));
|
|
||||||
locationList.append(location);
|
|
||||||
locationNameMap[QString(displayed_dive_site.name)] = location;
|
|
||||||
}
|
|
||||||
for_each_dive(idx, dive) {
|
for_each_dive(idx, dive) {
|
||||||
if (dive->hidden_by_filter)
|
// Don't show dive sites of hidden dives, unless this is the currently
|
||||||
|
// displayed (edited) dive.
|
||||||
|
if (dive->hidden_by_filter && dive != current_dive)
|
||||||
continue;
|
continue;
|
||||||
struct dive_site *ds = get_dive_site_for_dive(dive);
|
struct dive_site *ds = get_dive_site_for_dive(dive);
|
||||||
if (!dive_site_has_gps_location(ds) || ds->uuid == displayed_dive_site.uuid || locationUuids.contains(ds->uuid))
|
if (!dive_site_has_gps_location(ds) || locationUuids.contains(ds->uuid))
|
||||||
continue;
|
continue;
|
||||||
latitude = ds->latitude.udeg * 0.000001;
|
latitude = ds->latitude.udeg * 0.000001;
|
||||||
longitude = ds->longitude.udeg * 0.000001;
|
longitude = ds->longitude.udeg * 0.000001;
|
||||||
|
|
Loading…
Add table
Reference in a new issue