-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix import settings #4228
base: r4.9
Are you sure you want to change the base?
fix import settings #4228
Conversation
refactoring enum settings;
{ | ||
NSString *prefId = [self getPrefId]; | ||
if (customId && customId.length > 0) | ||
prefId = [prefId stringByAppendingString:customId]; | ||
|
||
return [[_settings registerIntPreference:prefId defValue:EOASunriseSunsetTimeLeft] makeProfile]; | ||
return [[_settings registerBooleanPreference:prefId defValue:YES] makeProfile]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did Integer become Boolean?
@@ -59,7 +59,7 @@ final class GradientUiHelper: NSObject { | |||
case .slope: | |||
typeValue = "°" | |||
case .height: | |||
if let formattedValue = OAOsmAndFormatter.getFormattedAlt(value, mc: OAAppSettings.sharedManager().metricSystem.get()) { | |||
if let formattedValue = OAOsmAndFormatter.getFormattedAlt(value, mc: EOAMetricsConstant(rawValue: Int(OAAppSettings.sharedManager().metricSystem.get()))!) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
force unwrap
@@ -85,15 +85,15 @@ final class GradientUiHelper: NSObject { | |||
switch colorizationType { | |||
case .speed: | |||
if analysis.maxSpeed != 0 { | |||
type = OASpeedConstant.toShortString(OAAppSettings.sharedManager().speedSystem.get()) | |||
type = OASpeedConstant.toShortString(EOASpeedConstant(rawValue: Int(OAAppSettings.sharedManager().speedSystem.get()))!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
up
stringValue = Self.formatValue(value, multiplier: analysis.maxSpeed) | ||
} | ||
case .elevation: | ||
let minElevation = analysis.minElevation | ||
let maxElevation = analysis.maxElevation + maxAltitudeAddition | ||
if minElevation != 99999.0 && maxElevation != -100.0 { | ||
let calculatedValue = value == 0 ? minElevation : minElevation + (value * (maxElevation - minElevation)) | ||
if let formattedValue = OAOsmAndFormatter.getFormattedAlt(calculatedValue, mc: OAAppSettings.sharedManager().metricSystem.get()) { | ||
if let formattedValue = OAOsmAndFormatter.getFormattedAlt(calculatedValue, mc: EOAMetricsConstant(rawValue: Int(OAAppSettings.sharedManager().metricSystem.get()))!) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
up
{ | ||
return [super get:mode]; | ||
enumClasses = [NSMutableArray array]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why in load? (sharedManager init)
{ | ||
[super set:rateUsState mode:mode]; | ||
[enumClasses addObject:self.class]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using + (void)load is not the most optimal solution in Objective-C. It's better to use a direct initializer
No description provided.