zbus update

This commit is contained in:
Ashley Wulber 2024-05-16 21:29:28 -04:00 • committed by Michael Murphy
parent 2e9660f2a8
commit 87250b5e50
23 changed files with 613 additions and 484 deletions

View file

@ -10,7 +10,7 @@ use crate::subscriptions::status_notifier_item::StatusNotifierItem;
// TODO: Don't use trait object
pub type EventStream = Pin<Box<dyn Stream<Item = Event> + Send>>;
#[zbus::dbus_proxy(
#[zbus::proxy(
interface = "org.kde.StatusNotifierWatcher",
default_service = "org.kde.StatusNotifierWatcher",
default_path = "/StatusNotifierWatcher"
@ -18,13 +18,13 @@ pub type EventStream = Pin<Box<dyn Stream<Item = Event> + Send>>;
trait StatusNotifierWatcher {
fn register_status_notifier_host(&self, name: &str) -> zbus::Result<()>;
#[dbus_proxy(property)]
#[zbus(property)]
fn registered_status_notifier_items(&self) -> zbus::Result<Vec<String>>;
#[dbus_proxy(signal)]
#[zbus(signal)]
fn status_notifier_item_registered(&self, name: &str) -> zbus::Result<()>;
#[dbus_proxy(signal)]
#[zbus(signal)]
fn status_notifier_item_unregistered(&self, name: &str) -> zbus::Result<()>;
}

View file

@ -30,7 +30,7 @@ impl StatusNotifierWatcher {
#[zbus(header)] hdr: MessageHeader<'_>,
#[zbus(signal_context)] ctxt: SignalContext<'_>,
) {
let sender = hdr.sender().unwrap().unwrap();
let sender = hdr.sender().unwrap();
let service = if service.starts_with('/') {
format!("{}{}", sender, service)
} else {