From 361ea7ce43f4e0d554e20b0d06f464d25a55d6c6 Mon Sep 17 00:00:00 2001 From: Ferdinand Bachmann Date: Sat, 14 Sep 2024 14:29:38 +0200 Subject: [PATCH] zbus: move to non-deprecated attribute macros --- src/client/main.rs | 4 ++-- src/input-backend/dbus_server.rs | 6 +++--- src/server/main.rs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/client/main.rs b/src/client/main.rs index 04b7471..0edda88 100644 --- a/src/client/main.rs +++ b/src/client/main.rs @@ -15,9 +15,9 @@ use gtk::{gio::ApplicationFlags, Application}; use gtk::{glib, prelude::*}; use std::env::args_os; use std::path::PathBuf; -use zbus::{blocking::Connection, dbus_proxy}; +use zbus::{blocking::Connection, proxy}; -#[dbus_proxy( +#[proxy( interface = "org.erikreider.swayosd", default_service = "org.erikreider.swayosd-server", default_path = "/org/erikreider/swayosd" diff --git a/src/input-backend/dbus_server.rs b/src/input-backend/dbus_server.rs index c2da3e3..13901d0 100644 --- a/src/input-backend/dbus_server.rs +++ b/src/input-backend/dbus_server.rs @@ -1,12 +1,12 @@ -use zbus::{dbus_interface, Connection, ConnectionBuilder, SignalContext}; +use zbus::{interface, Connection, ConnectionBuilder, SignalContext}; use crate::config::{DBUS_BACKEND_NAME, DBUS_PATH}; pub struct DbusServer; -#[dbus_interface(name = "org.erikreider.swayosd")] +#[interface(name = "org.erikreider.swayosd")] impl DbusServer { - #[dbus_interface(signal)] + #[zbus(signal)] pub async fn key_pressed( signal_ctxt: &SignalContext<'_>, key_code: u16, diff --git a/src/server/main.rs b/src/server/main.rs index d2f1a97..36acea2 100644 --- a/src/server/main.rs +++ b/src/server/main.rs @@ -35,13 +35,13 @@ use std::future::pending; use std::path::PathBuf; use std::str::FromStr; use utils::{get_system_css_path, user_style_path}; -use zbus::{dbus_interface, ConnectionBuilder}; +use zbus::{interface, ConnectionBuilder}; struct DbusServer { sender: Sender<(ArgTypes, String)>, } -#[dbus_interface(name = "org.erikreider.swayosd")] +#[interface(name = "org.erikreider.swayosd")] impl DbusServer { pub fn handle_action(&self, arg_type: String, data: String) -> bool { let arg_type = match ArgTypes::from_str(&arg_type) {