mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 01:50:06 +00:00 
			
		
		
		
	NOLINT setting settings defaults/minimums/maximums for magic numbers
This commit is contained in:
		
							parent
							
								
									c1aeefb0eb
								
							
						
					
					
						commit
						0a3913bdee
					
				
					 7 changed files with 24 additions and 1 deletions
				
			
		|  | @ -33,6 +33,8 @@ public: | |||
| 
 | ||||
|       boost::to_lower(defaultAlertLocationMethodValue); | ||||
| 
 | ||||
|       // SetDefault, SetMinimum and SetMaximum are descriptive
 | ||||
|       // NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers)
 | ||||
|       alertSoundFile_.SetDefault(defaultAlertSoundFileValue); | ||||
|       alertLocationMethod_.SetDefault(defaultAlertLocationMethodValue); | ||||
|       alertLatitude_.SetDefault(0.0); | ||||
|  | @ -48,7 +50,7 @@ public: | |||
|       alertLongitude_.SetMaximum(180.0); | ||||
|       alertRadius_.SetMinimum(0.0); | ||||
|       alertRadius_.SetMaximum(9999999999); | ||||
| 
 | ||||
|       // NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
 | ||||
| 
 | ||||
|       alertLocationMethod_.SetValidator( | ||||
|          SCWX_SETTINGS_ENUM_VALIDATOR(types::LocationMethod, | ||||
|  |  | |||
|  | @ -50,6 +50,8 @@ public: | |||
|       boost::to_lower(defaultPositioningPlugin); | ||||
|       boost::to_lower(defaultThemeValue); | ||||
| 
 | ||||
|       // SetDefault, SetMinimum, and SetMaximum are descriptive
 | ||||
|       // NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers)
 | ||||
|       antiAliasingEnabled_.SetDefault(true); | ||||
|       clockFormat_.SetDefault(defaultClockFormatValue); | ||||
|       customStyleDrawLayer_.SetDefault(".*\\.annotations\\.points"); | ||||
|  | @ -100,6 +102,7 @@ public: | |||
|       nmeaBaudRate_.SetMaximum(999999999); | ||||
|       radarSiteThreshold_.SetMinimum(-10000); | ||||
|       radarSiteThreshold_.SetMaximum(10000); | ||||
|       // NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
 | ||||
| 
 | ||||
|       customStyleDrawLayer_.SetTransform([](const std::string& value) | ||||
|                                          { return boost::trim_copy(value); }); | ||||
|  |  | |||
|  | @ -27,6 +27,8 @@ class LineSettings::Impl | |||
| public: | ||||
|    explicit Impl() | ||||
|    { | ||||
|       // SetDefault, SetMinimum, and SetMaximum are descriptive
 | ||||
|       // NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers)
 | ||||
|       lineColor_.SetDefault(kWhiteColorString_); | ||||
|       highlightColor_.SetDefault(kTransparentColorString_); | ||||
|       borderColor_.SetDefault(kBlackColorString_); | ||||
|  | @ -42,6 +44,7 @@ public: | |||
|       lineWidth_.SetMaximum(9); | ||||
|       highlightWidth_.SetMaximum(9); | ||||
|       borderWidth_.SetMaximum(9); | ||||
|       // NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
 | ||||
| 
 | ||||
|       lineColor_.SetValidator(&util::color::ValidateArgbString); | ||||
|       highlightColor_.SetValidator(&util::color::ValidateArgbString); | ||||
|  |  | |||
|  | @ -15,9 +15,12 @@ class ProductSettings::Impl | |||
| public: | ||||
|    explicit Impl() | ||||
|    { | ||||
|       // SetDefault, SetMinimum and SetMaximum are descriptive
 | ||||
|       // NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers)
 | ||||
|       showSmoothedRangeFolding_.SetDefault(false); | ||||
|       stiForecastEnabled_.SetDefault(true); | ||||
|       stiPastEnabled_.SetDefault(true); | ||||
|       // NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
 | ||||
|    } | ||||
| 
 | ||||
|    ~Impl() {} | ||||
|  |  | |||
|  | @ -50,12 +50,15 @@ public: | |||
| 
 | ||||
|       boost::to_lower(defaultTooltipMethodValue); | ||||
| 
 | ||||
|       // SetDefault, SetMinimum and SetMaximum are descriptive
 | ||||
|       // NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers)
 | ||||
|       hoverTextWrap_.SetDefault(80); | ||||
|       hoverTextWrap_.SetMinimum(0); | ||||
|       hoverTextWrap_.SetMaximum(999); | ||||
|       placefileTextDropShadowEnabled_.SetDefault(true); | ||||
|       radarSiteHoverTextEnabled_.SetDefault(true); | ||||
|       tooltipMethod_.SetDefault(defaultTooltipMethodValue); | ||||
|       // NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
 | ||||
| 
 | ||||
|       tooltipMethod_.SetValidator( | ||||
|          [](const std::string& value) | ||||
|  | @ -141,8 +144,11 @@ void TextSettings::Impl::InitializeFontVariables() | |||
|                                    { return !value.empty(); }); | ||||
| 
 | ||||
|       // Font point size must be between 6 and 72
 | ||||
|       // SetDefault, SetMinimum and SetMaximum are descriptive
 | ||||
|       // NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers)
 | ||||
|       font.fontPointSize_.SetMinimum(6.0); | ||||
|       font.fontPointSize_.SetMaximum(72.0); | ||||
|       // NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
 | ||||
| 
 | ||||
|       // Variable registration
 | ||||
|       auto& settings = fontSettings_.emplace_back( | ||||
|  |  | |||
|  | @ -14,6 +14,8 @@ class UiSettingsImpl | |||
| public: | ||||
|    explicit UiSettingsImpl() | ||||
|    { | ||||
|       // SetDefault, SetMinimum and SetMaximum are descriptive
 | ||||
|       // NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers)
 | ||||
|       level2ProductsExpanded_.SetDefault(false); | ||||
|       level2SettingsExpanded_.SetDefault(true); | ||||
|       level3ProductsExpanded_.SetDefault(true); | ||||
|  | @ -21,6 +23,7 @@ public: | |||
|       timelineExpanded_.SetDefault(true); | ||||
|       mainUIState_.SetDefault(""); | ||||
|       mainUIGeometry_.SetDefault(""); | ||||
|       // NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
 | ||||
|    } | ||||
| 
 | ||||
|    ~UiSettingsImpl() {} | ||||
|  |  | |||
|  | @ -35,11 +35,14 @@ public: | |||
|       boost::to_lower(defaultSpeedUnitsValue); | ||||
|       boost::to_lower(defaultDistanceUnitsValue); | ||||
| 
 | ||||
|       // SetDefault, SetMinimum and SetMaximum are descriptive
 | ||||
|       // NOLINTBEGIN(cppcoreguidelines-avoid-magic-numbers)
 | ||||
|       accumulationUnits_.SetDefault(defaultAccumulationUnitsValue); | ||||
|       echoTopsUnits_.SetDefault(defaultEchoTopsUnitsValue); | ||||
|       otherUnits_.SetDefault(defaultOtherUnitsValue); | ||||
|       speedUnits_.SetDefault(defaultSpeedUnitsValue); | ||||
|       distanceUnits_.SetDefault(defaultDistanceUnitsValue); | ||||
|       // NOLINTEND(cppcoreguidelines-avoid-magic-numbers)
 | ||||
| 
 | ||||
|       accumulationUnits_.SetValidator( | ||||
|          SCWX_SETTINGS_ENUM_VALIDATOR(types::AccumulationUnits, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak