mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Cleanup: remove redundant checks for null dive site
The dive_site_has_gps_location() function already checks for the null dive site. Remove redundant checks. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
53c9d524ca
commit
779c4eb5d0
2 changed files with 3 additions and 3 deletions
|
@ -34,7 +34,7 @@ void writeMarkers(struct membuffer *b, const bool selected_only)
|
|||
continue;
|
||||
}
|
||||
struct dive_site *ds = get_dive_site_for_dive(dive);
|
||||
if (!ds || !dive_site_has_gps_location(ds))
|
||||
if (!dive_site_has_gps_location(ds))
|
||||
continue;
|
||||
put_degrees(b, ds->location.lat, "temp = new google.maps.Marker({position: new google.maps.LatLng(", "");
|
||||
put_degrees(b, ds->location.lon, ",", ")});\n");
|
||||
|
|
|
@ -24,14 +24,14 @@ MapWidgetHelper::MapWidgetHelper(QObject *parent) : QObject(parent)
|
|||
|
||||
QGeoCoordinate MapWidgetHelper::getCoordinates(struct dive_site *ds)
|
||||
{
|
||||
if (!ds || !dive_site_has_gps_location(ds))
|
||||
if (!dive_site_has_gps_location(ds))
|
||||
return QGeoCoordinate(0.0, 0.0);
|
||||
return QGeoCoordinate(ds->location.lat.udeg * 0.000001, ds->location.lon.udeg * 0.000001);
|
||||
}
|
||||
|
||||
void MapWidgetHelper::centerOnDiveSite(struct dive_site *ds)
|
||||
{
|
||||
if (!ds || !dive_site_has_gps_location(ds)) {
|
||||
if (!dive_site_has_gps_location(ds)) {
|
||||
// dive site with no GPS
|
||||
m_mapLocationModel->setSelected(ds, false);
|
||||
QMetaObject::invokeMethod(m_map, "deselectMapLocation");
|
||||
|
|
Loading…
Reference in a new issue