init profile in constructor

This commit is contained in:
yggverse 2024-11-08 08:43:02 +02:00
parent 25b63c0e02
commit a0201ea83b
4 changed files with 21 additions and 28 deletions

View file

@ -2,29 +2,12 @@ mod action;
mod app;
mod profile;
use crate::profile::Profile;
use app::App;
use gtk::glib::ExitCode;
use std::rc::Rc;
const VENDOR: &str = "YGGverse";
const APP_ID: &str = "Yoda";
const BRANCH: &str = "master";
fn main() -> ExitCode {
match gtk::init() {
Ok(_) => App::new(Rc::new(Profile::new(
VENDOR,
APP_ID,
BRANCH,
format!(
"{}.{}",
env!("CARGO_PKG_VERSION_MAJOR"),
env!("CARGO_PKG_VERSION_MINOR")
)
.as_str(),
)))
.run(),
Ok(_) => App::new().run(),
Err(_) => ExitCode::FAILURE,
}
}