diff --git a/src/backend/manager.rs b/src/backend/manager.rs index 0ab65da..f9ce843 100644 --- a/src/backend/manager.rs +++ b/src/backend/manager.rs @@ -50,6 +50,7 @@ mod imp { pub(crate) device_model: gio::ListStore, pub metadata_om: OnceCell, + #[property(get)] pub metadata: RefCell>, #[property(get)] diff --git a/src/backend/pwnodeobject.rs b/src/backend/pwnodeobject.rs index 7345dbd..733f7c7 100644 --- a/src/backend/pwnodeobject.rs +++ b/src/backend/pwnodeobject.rs @@ -474,7 +474,7 @@ impl PwNodeObject { let manager = PwvucontrolManager::default(); - if let Some(metadata) = manager.imp().metadata.borrow().as_ref() { + if let Some(metadata) = manager.metadata() { metadata.set(self.boundid(), Some("target.node"), Some("Spa:Id"), Some(&target_node.boundid().to_string())); metadata.set(self.boundid(), Some("target.object"), Some("Spa:Id"), Some(&target_node.serial().to_string())); } else { @@ -510,7 +510,7 @@ impl PwNodeObject { let manager = PwvucontrolManager::default(); let om = manager.imp().wp_object_manager.get().unwrap(); - if let Some(metadata) = manager.imp().metadata.borrow().as_ref() { + if let Some(metadata) = manager.metadata() { if let Some(target_serial) = metadata.find_notype(self.boundid(), "target.object") { if target_serial != "-1" { if let Some(sinknode) = om.lookup([ @@ -545,7 +545,7 @@ impl PwNodeObject { pub(crate) fn unset_default_target(&self) { let manager = PwvucontrolManager::default(); - if let Some(metadata) = manager.imp().metadata.borrow().as_ref() { + if let Some(metadata) = manager.metadata() { metadata.set(self.boundid(), Some("target.node"), Some("Spa:Id"), Some("-1")); metadata.set(self.boundid(), Some("target.object"), Some("Spa:Id"), Some("-1")); } else { diff --git a/src/ui/volumebox.rs b/src/ui/volumebox.rs index 3c6e372..fdea091 100644 --- a/src/ui/volumebox.rs +++ b/src/ui/volumebox.rs @@ -191,7 +191,7 @@ mod imp { fn dispose(&self) { if let Some(sid) = self.metadata_changed_event.take() { let manager = PwvucontrolManager::default(); - if let Some(metadata) = manager.imp().metadata.borrow().as_ref() { + if let Some(metadata) = manager.metadata() { metadata.disconnect(sid); }; };