diff options
Diffstat (limited to 'schist_desktop_gui/src/main.rs')
| -rw-r--r-- | schist_desktop_gui/src/main.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/schist_desktop_gui/src/main.rs b/schist_desktop_gui/src/main.rs index 6dd2622..a5749d3 100644 --- a/schist_desktop_gui/src/main.rs +++ b/schist_desktop_gui/src/main.rs @@ -1,3 +1,4 @@ +mod cache; mod config; mod database_connection; mod dialog; @@ -10,22 +11,24 @@ mod theme; mod traits; mod window_settings; +pub use cache::Cache; pub use database_connection::DatabaseConnection; use anyhow::Context; use crate::{ - config::Config, gui::Gui, settings::make_settings, theme::make_theme, + cache::get_cache, config::Config, gui::Gui, settings::make_settings, theme::make_theme, window_settings::make_window_settings, }; fn main() -> anyhow::Result<()> { + let cache = get_cache().unwrap_or_else(|_| Cache::default()); let config = Config::default(); iced::application("Schist", Gui::update, Gui::view) .settings(make_settings(&config.clone())) .subscription(gui::subscription) .theme(make_theme) .window(make_window_settings(&config.clone())) - .run_with(Gui::new) + .run_with(move || Gui::new(&cache)) .context("Failed to run Schist GUI") } |
