status-area: Use zbus::interface instead of deprecated dbus_interface
This commit is contained in:
parent
9d53cfa9e5
commit
3641bf8bce
1 changed files with 8 additions and 9 deletions
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
use futures::prelude::*;
|
use futures::prelude::*;
|
||||||
use zbus::{
|
use zbus::{
|
||||||
dbus_interface,
|
|
||||||
fdo::{DBusProxy, RequestNameFlags, RequestNameReply},
|
fdo::{DBusProxy, RequestNameFlags, RequestNameReply},
|
||||||
names::{BusName, UniqueName, WellKnownName},
|
names::{BusName, UniqueName, WellKnownName},
|
||||||
MessageHeader, Result, SignalContext,
|
MessageHeader, Result, SignalContext,
|
||||||
|
|
@ -22,7 +21,7 @@ struct StatusNotifierWatcher {
|
||||||
items: Vec<(UniqueName<'static>, String)>,
|
items: Vec<(UniqueName<'static>, String)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[dbus_interface(name = "org.kde.StatusNotifierWatcher")]
|
#[zbus::interface(name = "org.kde.StatusNotifierWatcher")]
|
||||||
impl StatusNotifierWatcher {
|
impl StatusNotifierWatcher {
|
||||||
async fn register_status_notifier_item(
|
async fn register_status_notifier_item(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
|
@ -47,35 +46,35 @@ impl StatusNotifierWatcher {
|
||||||
// XXX emit registed/unregistered
|
// XXX emit registed/unregistered
|
||||||
}
|
}
|
||||||
|
|
||||||
#[dbus_interface(property)]
|
#[zbus(property)]
|
||||||
fn registered_status_notifier_items(&self) -> Vec<String> {
|
fn registered_status_notifier_items(&self) -> Vec<String> {
|
||||||
self.items.iter().map(|(_, x)| x.clone()).collect()
|
self.items.iter().map(|(_, x)| x.clone()).collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[dbus_interface(property)]
|
#[zbus(property)]
|
||||||
fn is_status_notifier_host_registered(&self) -> bool {
|
fn is_status_notifier_host_registered(&self) -> bool {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
#[dbus_interface(property)]
|
#[zbus(property)]
|
||||||
fn protocol_version(&self) -> i32 {
|
fn protocol_version(&self) -> i32 {
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
|
|
||||||
#[dbus_interface(signal)]
|
#[zbus(signal)]
|
||||||
async fn status_notifier_item_registered(ctxt: &SignalContext<'_>, service: &str)
|
async fn status_notifier_item_registered(ctxt: &SignalContext<'_>, service: &str)
|
||||||
-> Result<()>;
|
-> Result<()>;
|
||||||
|
|
||||||
#[dbus_interface(signal)]
|
#[zbus(signal)]
|
||||||
async fn status_notifier_item_unregistered(
|
async fn status_notifier_item_unregistered(
|
||||||
ctxt: &SignalContext<'_>,
|
ctxt: &SignalContext<'_>,
|
||||||
service: &str,
|
service: &str,
|
||||||
) -> Result<()>;
|
) -> Result<()>;
|
||||||
|
|
||||||
#[dbus_interface(signal)]
|
#[zbus(signal)]
|
||||||
async fn status_notifier_host_registered(ctxt: &SignalContext<'_>) -> Result<()>;
|
async fn status_notifier_host_registered(ctxt: &SignalContext<'_>) -> Result<()>;
|
||||||
|
|
||||||
#[dbus_interface(signal)]
|
#[zbus(signal)]
|
||||||
async fn status_notifier_host_unregistered(ctxt: &SignalContext<'_>) -> Result<()>;
|
async fn status_notifier_host_unregistered(ctxt: &SignalContext<'_>) -> Result<()>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue