Skip to content

Commit

Permalink
Merge pull request #138 from marhkb/fixes
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
marhkb committed Apr 4, 2022
2 parents 88ed40f + e991ab9 commit 6748af3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/model/abstract_container_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub(crate) trait AbstractContainerListExt: IsA<AbstractContainerList> {
})
}

fn connect_name_changed<F: Fn(&Self, &model::Container) + 'static>(
fn connect_container_name_changed<F: Fn(&Self, &model::Container) + 'static>(
&self,
f: F,
) -> glib::SignalHandlerId {
Expand Down
27 changes: 14 additions & 13 deletions src/view/container/containers_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use gtk::{gio, glib, CompositeTemplate};
use once_cell::sync::Lazy;
use once_cell::unsync::OnceCell;

use crate::model::AbstractContainerListExt;
use crate::{model, utils, view};

mod imp {
Expand Down Expand Up @@ -241,21 +242,21 @@ impl ContainersGroup {

if let Some(value) = value {
// TODO: For multi-client: Figure out whether signal handlers need to be disconnected.
value.connect_local(
"container-name-changed",
false,
clone!(@weak self as obj => @default-return None, move |_| {
glib::timeout_add_seconds_local_once(
1,
clone!(@weak obj => move || {
obj.update_search_filter();
obj.update_sorter();
}),
);
None
}),
value.connect_notify_local(
Some("running"),
clone!(@weak self as obj => move |_, _| obj.update_properties_filter()),
);

value.connect_container_name_changed(clone!(@weak self as obj => move |_, _| {
glib::timeout_add_seconds_local_once(
1,
clone!(@weak obj => move || {
obj.update_search_filter();
obj.update_sorter();
}),
);
}));

let model = gtk::SortListModel::new(
Some(&gtk::FilterListModel::new(
Some(&gtk::FilterListModel::new(
Expand Down

0 comments on commit 6748af3

Please sign in to comment.