Add validation to textarea

This commit is contained in:
2025-10-16 18:51:24 +08:00
parent 5f0238d3e3
commit 71122e87ae
5 changed files with 102 additions and 42 deletions

View File

@@ -50,7 +50,7 @@ impl ApplicationConfig {
conf
}
pub fn write_to_file(self, path: &PathBuf) -> Result<()> {
fn write_to_file(self, path: &PathBuf) -> Result<()> {
let mut conf = Ini::new();
conf.with_section(Some("Basic"))
.set("DBPath", self.basic_config.db_path)
@@ -67,4 +67,8 @@ impl ApplicationConfig {
conf.write_to_file(path)?;
Ok(())
}
pub fn save(&self) -> Result<()> {
self.clone().write_to_file(&APP_CONIFG_FILE_PATH.to_path_buf())
}
}