summaryrefslogtreecommitdiff
path: root/schist_desktop_gui/src/main.rs
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2026-02-07 18:45:08 +0000
committerJoe Carstairs <me@joeac.net>2026-02-07 18:45:17 +0000
commit65596363d43995bf2002d4aa8405d84484f2542b (patch)
tree830846f335d97a236c61ff8ac3a9080b455e3b4a /schist_desktop_gui/src/main.rs
parent0986b29354690327b5dafc852667c7dc191d1a22 (diff)
task-088: cache open file
Diffstat (limited to 'schist_desktop_gui/src/main.rs')
-rw-r--r--schist_desktop_gui/src/main.rs7
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")
}