From 7b1b56e97047be09bf8e44cb1980a558dd917ba8 Mon Sep 17 00:00:00 2001 From: AdenKoperczak Date: Fri, 13 Dec 2024 10:29:54 -0500 Subject: [PATCH] add const for set unit callbacks --- scwx-qt/source/scwx/qt/ui/settings_dialog.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp b/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp index ea228454..3a08bac0 100644 --- a/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp +++ b/scwx-qt/source/scwx/qt/ui/settings_dialog.cpp @@ -754,10 +754,10 @@ void SettingsDialogImpl::SetupGeneralTab() radarSiteThreshold_.SetUnitLabel(self_->ui->radarSiteThresholdUnitLabel); auto radarSiteThresholdUpdateUnits = [this](const std::string& newValue) { - types::DistanceUnits radiusUnits = + const types::DistanceUnits radiusUnits = types::GetDistanceUnitsFromName(newValue); - double radiusScale = types::GetDistanceUnitsScale(radiusUnits); - std::string abbreviation = + const double radiusScale = types::GetDistanceUnitsScale(radiusUnits); + const std::string abbreviation = types::GetDistanceUnitsAbbreviation(radiusUnits); radarSiteThreshold_.SetUnit(radiusScale, abbreviation); @@ -1073,10 +1073,10 @@ void SettingsDialogImpl::SetupAudioTab() alertAudioRadius_.SetUnitLabel(self_->ui->alertAudioRadiusUnitsLabel); auto alertAudioRadiusUpdateUnits = [this](const std::string& newValue) { - types::DistanceUnits radiusUnits = + const types::DistanceUnits radiusUnits = types::GetDistanceUnitsFromName(newValue); - double radiusScale = types::GetDistanceUnitsScale(radiusUnits); - std::string abbreviation = + const double radiusScale = types::GetDistanceUnitsScale(radiusUnits); + const std::string abbreviation = types::GetDistanceUnitsAbbreviation(radiusUnits); alertAudioRadius_.SetUnit(radiusScale, abbreviation);