Use _ in names of cosmic-config settings
This commit is contained in:
parent
e0ae268f11
commit
f22b8ec614
1 changed files with 7 additions and 7 deletions
|
|
@ -64,9 +64,9 @@ fn get_config<T: Default + serde::de::DeserializeOwned>(
|
||||||
impl Default for Page {
|
impl Default for Page {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
let config = cosmic_config::Config::new("com.system76.CosmicComp", 1).unwrap();
|
let config = cosmic_config::Config::new("com.system76.CosmicComp", 1).unwrap();
|
||||||
let input_default: InputConfig = get_config(&config, "input-default");
|
let input_default: InputConfig = get_config(&config, "input_default");
|
||||||
let input_touchpad: InputConfig = get_config(&config, "input-touchpad");
|
let input_touchpad: InputConfig = get_config(&config, "input_touchpad");
|
||||||
let xkb = get_config(&config, "xkb-config");
|
let xkb = get_config(&config, "xkb_config");
|
||||||
|
|
||||||
let mut primary_button = mouse::default_primary_button();
|
let mut primary_button = mouse::default_primary_button();
|
||||||
let idx = if input_default.left_handed.unwrap_or(false) {
|
let idx = if input_default.left_handed.unwrap_or(false) {
|
||||||
|
|
@ -107,9 +107,9 @@ impl Default for Page {
|
||||||
impl Page {
|
impl Page {
|
||||||
fn update_input<F: Fn(&mut InputConfig)>(&mut self, touchpad: bool, f: F) {
|
fn update_input<F: Fn(&mut InputConfig)>(&mut self, touchpad: bool, f: F) {
|
||||||
let (name, input_config) = if touchpad {
|
let (name, input_config) = if touchpad {
|
||||||
("input-touchpad", &mut self.input_touchpad)
|
("input_touchpad", &mut self.input_touchpad)
|
||||||
} else {
|
} else {
|
||||||
("input-default", &mut self.input_default)
|
("input_default", &mut self.input_default)
|
||||||
};
|
};
|
||||||
f(input_config);
|
f(input_config);
|
||||||
if let Err(err) = self.config.set(name, input_config) {
|
if let Err(err) = self.config.set(name, input_config) {
|
||||||
|
|
@ -194,8 +194,8 @@ impl Page {
|
||||||
.chain(id.into_iter())
|
.chain(id.into_iter())
|
||||||
.join(",");
|
.join(",");
|
||||||
self.xkb.options = Some(new_options).filter(|x| !x.is_empty());
|
self.xkb.options = Some(new_options).filter(|x| !x.is_empty());
|
||||||
if let Err(err) = self.config.set("xkb-config", &self.xkb) {
|
if let Err(err) = self.config.set("xkb_config", &self.xkb) {
|
||||||
error!(?err, "Failed to set config 'xkb-config'");
|
error!(?err, "Failed to set config 'xkb_config'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue