mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: move divesite_has_gps_information() to struct dive_site
Seems logical in a C++ code base. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
c812dd140b
commit
0aa4efb3d9
14 changed files with 20 additions and 21 deletions
|
@ -259,7 +259,7 @@ void LocationInformationWidget::initFields(dive_site *ds)
|
|||
if (ds) {
|
||||
filter_model.set(ds, ds->location);
|
||||
updateLabels();
|
||||
enableLocationButtons(dive_site_has_gps_location(ds));
|
||||
enableLocationButtons(ds->has_gps_location());
|
||||
DiveFilter::instance()->startFilterDiveSites(std::vector<dive_site *>{ ds });
|
||||
filter_model.invalidate();
|
||||
} else {
|
||||
|
|
|
@ -61,7 +61,7 @@ void MapWidget::centerOnIndex(const QModelIndex& idx)
|
|||
{
|
||||
CHECK_IS_READY_RETURN_VOID();
|
||||
dive_site *ds = idx.model()->index(idx.row(), LocationInformationModel::DIVESITE).data().value<dive_site *>();
|
||||
if (!ds || ds == RECENTLY_ADDED_DIVESITE || !dive_site_has_gps_location(ds))
|
||||
if (!ds || ds == RECENTLY_ADDED_DIVESITE || !ds->has_gps_location())
|
||||
m_mapHelper->centerOnSelectedDiveSite();
|
||||
else
|
||||
centerOnDiveSite(ds);
|
||||
|
|
|
@ -471,7 +471,7 @@ void LocationFilterDelegate::paint(QPainter *painter, const QStyleOptionViewItem
|
|||
if (bottomText.isEmpty())
|
||||
bottomText = printGPSCoords(&ds->location);
|
||||
|
||||
if (dive_site_has_gps_location(ds) && currentDiveHasGPS) {
|
||||
if (ds->has_gps_location() && currentDiveHasGPS) {
|
||||
// so we are showing a completion and both the current dive site and the completion
|
||||
// have a GPS fix... so let's show the distance
|
||||
if (ds->location == currentLocation) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue