Refactorings

This commit is contained in:
Savanni D'Gerinel 2023-12-28 22:18:51 -05:00
parent 8049859816
commit 68b47ffa1a
2 changed files with 2 additions and 10 deletions

View File

@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with Fit
use crate::{ use crate::{
app::App, app::App,
views::{HistoricalView, PlaceholderView, View, ViewName, WelcomeView}, views::{HistoricalView, PlaceholderView, View, WelcomeView},
}; };
use adw::prelude::*; use adw::prelude::*;
use chrono::{Duration, Local}; use chrono::{Duration, Local};
@ -148,13 +148,11 @@ impl AppWindow {
} }
fn on_apply_config(&self, path: PathBuf) { fn on_apply_config(&self, path: PathBuf) {
println!("saving configuration");
glib::spawn_future_local({ glib::spawn_future_local({
let s = self.clone(); let s = self.clone();
async move { async move {
if s.app.open_db(path.clone()).await.is_ok() { if s.app.open_db(path.clone()).await.is_ok() {
let settings = gio::Settings::new(&s.app_id); let _ = s.settings.set("series-path", path.to_str().unwrap());
let _ = settings.set("series-path", path.to_str().unwrap());
s.show_historical_view(); s.show_historical_view();
} }
} }

View File

@ -25,12 +25,6 @@ pub use placeholder_view::PlaceholderView;
mod welcome_view; mod welcome_view;
pub use welcome_view::WelcomeView; pub use welcome_view::WelcomeView;
#[derive(Clone, Debug, PartialEq)]
pub enum ViewName {
Welcome,
Historical,
}
pub enum View { pub enum View {
Placeholder(PlaceholderView), Placeholder(PlaceholderView),
Welcome(WelcomeView), Welcome(WelcomeView),