From 65596363d43995bf2002d4aa8405d84484f2542b Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Sat, 7 Feb 2026 18:45:08 +0000 Subject: task-088: cache open file --- schist_desktop_gui/src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'schist_desktop_gui/src/main.rs') 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") } -- cgit v1.2.3