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::{
app::App,
views::{HistoricalView, PlaceholderView, View, ViewName, WelcomeView},
views::{HistoricalView, PlaceholderView, View, WelcomeView},
};
use adw::prelude::*;
use chrono::{Duration, Local};
@ -148,13 +148,11 @@ impl AppWindow {
}
fn on_apply_config(&self, path: PathBuf) {
println!("saving configuration");
glib::spawn_future_local({
let s = self.clone();
async move {
if s.app.open_db(path.clone()).await.is_ok() {
let settings = gio::Settings::new(&s.app_id);
let _ = settings.set("series-path", path.to_str().unwrap());
let _ = s.settings.set("series-path", path.to_str().unwrap());
s.show_historical_view();
}
}

View File

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