Commit d5041715 authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui

Drop various uneeded constructors

parent e386df84
...@@ -82,14 +82,6 @@ glib::wrapper! { ...@@ -82,14 +82,6 @@ glib::wrapper! {
} }
impl Application { 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 { fn window(&self) -> Window {
self.imp().window.get().and_then(|w| w.upgrade()).unwrap() self.imp().window.get().and_then(|w| w.upgrade()).unwrap()
} }
...@@ -98,7 +90,15 @@ impl Application { ...@@ -98,7 +90,15 @@ impl Application {
log::info!("GNOME Tour ({})", config::APP_ID); log::info!("GNOME Tour ({})", config::APP_ID);
log::info!("Version: {} ({})", config::VERSION, config::PROFILE); log::info!("Version: {} ({})", config::VERSION, config::PROFILE);
log::info!("Datadir: {}", config::PKGDATADIR); log::info!("Datadir: {}", config::PKGDATADIR);
let app = Self::new(); Self::default().run()
app.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! { ...@@ -115,13 +115,3 @@ glib::wrapper! {
pub struct ImagePageWidget(ObjectSubclass<imp::ImagePageWidget>) pub struct ImagePageWidget(ObjectSubclass<imp::ImagePageWidget>)
@extends gtk::Widget, gtk::Box; @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! { ...@@ -91,10 +91,6 @@ glib::wrapper! {
} }
impl PaginatorWidget { impl PaginatorWidget {
pub fn new() -> Self {
glib::Object::new()
}
pub fn try_next(&self) -> Option<()> { pub fn try_next(&self) -> Option<()> {
let imp = self.imp(); let imp = self.imp();
let p = imp.current_page.get() + 1; let p = imp.current_page.get() + 1;
...@@ -189,9 +185,3 @@ impl PaginatorWidget { ...@@ -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