fix: unclear error messages
This commit is contained in:
@ -479,6 +479,21 @@ impl Profile {
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn load_segatools_ini(&mut self, path: impl AsRef<Path>) -> Result<()> {
|
||||
let str = std::fs::read_to_string(path.as_ref())?;
|
||||
// Stupid path escape hack for the ini reader
|
||||
let str = str.replace("\\", "\\\\").replace("\\\\\\\\", "\\\\");
|
||||
let ini = ini::Ini::load_from_str(&str)?;
|
||||
self.data.sgt.load_from_ini(&ini, self.config_dir())?;
|
||||
self.data.network.load_from_ini(&ini)?;
|
||||
if let Some(kb) = &mut self.data.keyboard {
|
||||
kb.load_from_ini(&ini)?;
|
||||
}
|
||||
self.save()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl ProfilePaths for Profile {
|
||||
|
Reference in New Issue
Block a user