Add OS specific settings (#35756)
Release Notes: - Settings can now be configured per operating system with the new top-level fields: `"macos"`/`"windows"`/`"linux"`. These will override user level settings, but are lower precedence than _release channel_ settings.
This commit is contained in:
parent
fa2ff3ce1c
commit
e2e147ab0e
4 changed files with 45 additions and 10 deletions
|
@ -134,10 +134,15 @@ impl Settings for AutoUpdateSetting {
|
|||
type FileContent = Option<AutoUpdateSettingContent>;
|
||||
|
||||
fn load(sources: SettingsSources<Self::FileContent>, _: &mut App) -> Result<Self> {
|
||||
let auto_update = [sources.server, sources.release_channel, sources.user]
|
||||
.into_iter()
|
||||
.find_map(|value| value.copied().flatten())
|
||||
.unwrap_or(sources.default.ok_or_else(Self::missing_default)?);
|
||||
let auto_update = [
|
||||
sources.server,
|
||||
sources.release_channel,
|
||||
sources.operating_system,
|
||||
sources.user,
|
||||
]
|
||||
.into_iter()
|
||||
.find_map(|value| value.copied().flatten())
|
||||
.unwrap_or(sources.default.ok_or_else(Self::missing_default)?);
|
||||
|
||||
Ok(Self(auto_update.0))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue