sidebar: Use freeze_notify

Closes #763
This commit is contained in:
Kévin Commaille 2021-05-21 17:04:10 +02:00
parent 704773abfb
commit 7617aaa923
No known key found for this signature in database
GPG key ID: 296D60AE1E61661C

View file

@ -168,6 +168,8 @@ impl Selection {
pub fn set_model<P: IsA<gio::ListModel>>(&self, model: Option<&P>) {
let priv_ = imp::Selection::from_instance(self);
let _guard = self.freeze_notify();
let model = model.map(|m| m.clone().upcast::<gio::ListModel>());
let old_model = self.model();
@ -306,6 +308,8 @@ impl Selection {
fn items_changed_cb(&self, model: &gio::ListModel, position: u32, removed: u32, added: u32) {
let priv_ = imp::Selection::from_instance(self);
let _guard = self.freeze_notify();
let selected = self.selected();
let selected_room = self.selected_room();