Desktop: Fix units displayed for 'Near dive sites' range.

Fix a bug causing the wrong units (m) to be shown on the Dive site
management view if imperial units are as the system default.

Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
Michael Keller 2023-02-24 23:46:23 +13:00 committed by bstoeger
parent ffc9502535
commit d44787a0b3

View file

@ -43,7 +43,6 @@ LocationInformationWidget::LocationInformationWidget(QWidget *parent) : QGroupBo
connect(&diveListNotifier, &DiveListNotifier::diveSiteChanged, this, &LocationInformationWidget::diveSiteChanged); connect(&diveListNotifier, &DiveListNotifier::diveSiteChanged, this, &LocationInformationWidget::diveSiteChanged);
connect(&diveListNotifier, &DiveListNotifier::diveSiteDeleted, this, &LocationInformationWidget::diveSiteDeleted); connect(&diveListNotifier, &DiveListNotifier::diveSiteDeleted, this, &LocationInformationWidget::diveSiteDeleted);
connect(qPrefUnits::instance(), &qPrefUnits::unit_systemChanged, this, &LocationInformationWidget::unitsChanged); connect(qPrefUnits::instance(), &qPrefUnits::unit_systemChanged, this, &LocationInformationWidget::unitsChanged);
unitsChanged();
ui.diveSiteListView->setModel(&filter_model); ui.diveSiteListView->setModel(&filter_model);
ui.diveSiteListView->setModelColumn(LocationInformationModel::NAME); ui.diveSiteListView->setModelColumn(LocationInformationModel::NAME);
@ -244,6 +243,8 @@ void LocationInformationWidget::initFields(dive_site *ds)
filter_model.set(0, zero_location); filter_model.set(0, zero_location);
clearLabels(); clearLabels();
} }
unitsChanged();
} }
void LocationInformationWidget::on_GPSbutton_clicked() void LocationInformationWidget::on_GPSbutton_clicked()