From 3a7756cb2307df4ac3190a2665436f1bb9449823 Mon Sep 17 00:00:00 2001 From: Salem Yaslem Date: Mon, 8 Feb 2021 04:29:45 +0300 Subject: [PATCH] merge config from previous versions --- src/config_management.rs | 4 +++- src/main.rs | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config_management.rs b/src/config_management.rs index 4ef87a9..4370abb 100644 --- a/src/config_management.rs +++ b/src/config_management.rs @@ -18,12 +18,14 @@ pub fn initialize() -> PathBuf { std::fs::create_dir_all(&config_directories).unwrap_or_default(); std::fs::File::create(&config_path).unwrap(); default(); + } else { + merge_previous_version(); } config_path } -pub fn merge_previous_version() -> Option { +fn merge_previous_version() -> Option { let config_path: PathBuf = Path::new(&get_user_data_dir().unwrap()) .join("blue-recorder") .join("config.ini"); diff --git a/src/main.rs b/src/main.rs index b48fc11..278355a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,7 +21,6 @@ fn main() { } let builder: Builder = Builder::from_file(Path::new("windows/ui.glade")); - config_management::merge_previous_version(); config_management::initialize(); // get Objects from UI