Commit d5041715 authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui

Drop various uneeded constructors

parent e386df84
......@@ -82,14 +82,6 @@ glib::wrapper! {
}
impl Application {
#[allow(clippy::new_without_default)]
pub fn new() -> Self {
glib::Object::builder()
.property("application-id", &config::APP_ID)
.property("resource-base-path", &Some("/org/gnome/Tour"))
.build()
}
fn window(&self) -> Window {
self.imp().window.get().and_then(|w| w.upgrade()).unwrap()
}
......@@ -98,7 +90,15 @@ impl Application {
log::info!("GNOME Tour ({})", config::APP_ID);
log::info!("Version: {} ({})", config::VERSION, config::PROFILE);
log::info!("Datadir: {}", config::PKGDATADIR);
let app = Self::new();
app.run()
Self::default().run()
}
}
impl Default for Application {
fn default() -> Self {
glib::Object::builder()
.property("application-id", config::APP_ID)
.property("resource-base-path", "/org/gnome/Tour")
.build()
}
}
......@@ -115,13 +115,3 @@ glib::wrapper! {
pub struct ImagePageWidget(ObjectSubclass<imp::ImagePageWidget>)
@extends gtk::Widget, gtk::Box;
}
impl ImagePageWidget {
pub fn new(resource_uri: &str, head: String, body: String) -> Self {
glib::Object::builder()
.property("resource-uri", &resource_uri)
.property("head", &head)
.property("body", &body)
.build()
}
}
......@@ -91,10 +91,6 @@ glib::wrapper! {
}
impl PaginatorWidget {
pub fn new() -> Self {
glib::Object::new()
}
pub fn try_next(&self) -> Option<()> {
let imp = self.imp();
let p = imp.current_page.get() + 1;
......@@ -189,9 +185,3 @@ impl PaginatorWidget {
}
}
}
impl Default for PaginatorWidget {
fn default() -> Self {
Self::new()
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment