Cleaned up unnecessary clone() calls.

This commit is contained in:
Jordan Petridis
2017-10-21 09:08:03 +03:00
parent 64cd388aeb
commit 90c637ed53
7 changed files with 24 additions and 27 deletions
+7 -7
View File
@@ -51,7 +51,7 @@ pub fn populate_podcasts_flowbox(
f.connect_activate(move |_| {
let old = stack_clone.get_child_by_name("pdw").unwrap();
let pdw = podcast_widget(
&db_clone.clone(),
&db_clone,
Some(title.as_str()),
description.as_ref().map(|x| x.as_str()),
pixbuf.clone(),
@@ -72,7 +72,7 @@ pub fn populate_podcasts_flowbox(
}
fn setup_podcast_widget(db: &Arc<Mutex<SqliteConnection>>, stack: &gtk::Stack) {
let pd_widget = podcast_widget(&db.clone(), None, None, None);
let pd_widget = podcast_widget(&db, None, None, None);
stack.add_named(&pd_widget, "pdw");
}
@@ -87,14 +87,14 @@ fn setup_podcasts_grid(db: &Arc<Mutex<SqliteConnection>>, stack: &gtk::Stack) {
// FIXME: flowbox childs activate with space/enter but not with clicks.
let flowbox: gtk::FlowBox = builder.get_object("flowbox").unwrap();
// Populate the flowbox with the Podcasts.
populate_podcasts_flowbox(&db.clone(), &stack.clone(), &flowbox.clone());
populate_podcasts_flowbox(&db, &stack, &flowbox);
}
pub fn setup_stack(db: &Arc<Mutex<SqliteConnection>>) -> gtk::Stack {
let stack = gtk::Stack::new();
let _st_clone = stack.clone();
setup_podcast_widget(&db.clone(), &stack.clone());
setup_podcasts_grid(&db.clone(), &stack.clone());
// let _st_clone = stack.clone();
setup_podcast_widget(&db, &stack);
setup_podcasts_grid(&db, &stack);
// stack.connect("foo", true, move |_| {
// update_podcasts_view(db.clone(), st_clone.clone());
// None
@@ -109,7 +109,7 @@ pub fn update_podcasts_view(db: &Arc<Mutex<SqliteConnection>>, stack: &gtk::Stac
let flowbox: gtk::FlowBox = builder.get_object("flowbox").unwrap();
// Populate the flowbox with the Podcasts.
populate_podcasts_flowbox(&db.clone(), &stack.clone(), &flowbox.clone());
populate_podcasts_flowbox(&db, &stack, &flowbox);
let old = stack.get_child_by_name("pd_grid").unwrap();
stack.remove(&old);