Skip to content

Commit

Permalink
chore: bump to new zbus
Browse files Browse the repository at this point in the history
  • Loading branch information
Decodetalkers committed Oct 22, 2024
1 parent 1a087ee commit 4e3ca09
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 54 deletions.
78 changes: 34 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ members = ["libs/screenshotdialog", "libs/accessdialog", "."]
screenshotdialog = { path = "libs/screenshotdialog" }
accessdialog = { path = "libs/accessdialog" }

zbus = { version = "4", default-features = false, features = ["tokio", "url"] }
zbus = { version = "5", default-features = false, features = ["tokio", "url"] }
tokio = { version = "1.40.0", features = ["full"] }
serde = { version = "1.0.210", features = ["derive"] }
tracing = "0.1.40"
Expand All @@ -26,7 +26,7 @@ image = { version = "0.25", default-features = false, features = [

bitflags = "2.6.0"
enumflags2 = "0.7.10"
anyhow = "1.0.89"
anyhow = "1.0.90"

# pipewire
pipewire = "0.8.0"
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use settings::{AccentColor, SettingsBackend, SettingsConfig, SETTING_CONFIG};

use std::collections::HashMap;
use std::future::pending;
use zbus::{zvariant, Connection, ConnectionBuilder, SignalContext};
use zbus::{connection, object_server::SignalEmitter, zvariant, Connection};

use futures::{
channel::mpsc::{channel, Receiver},
Expand Down Expand Up @@ -93,7 +93,7 @@ async fn async_watch<P: AsRef<Path>>(path: P) -> notify::Result<()> {
let (mut watcher, mut rx) = async_watcher()?;

let signal_context =
SignalContext::new(&connection, "/org/freedesktop/portal/desktop").unwrap();
SignalEmitter::new(&connection, "/org/freedesktop/portal/desktop").unwrap();
// Add a path to be watched. All files and directories at that path and
// below will be monitored for changes.
watcher.watch(path.as_ref(), RecursiveMode::Recursive)?;
Expand Down Expand Up @@ -133,7 +133,7 @@ async fn main() -> anyhow::Result<()> {
tracing_subscriber::fmt().init();
tracing::info!("luminous Start");

let conn = ConnectionBuilder::session()?
let conn = connection::Builder::session()?
.name("org.freedesktop.impl.portal.desktop.luminous")?
.serve_at("/org/freedesktop/portal/desktop", AccessBackend)?
.serve_at("/org/freedesktop/portal/desktop", ScreenShotBackend)?
Expand Down
6 changes: 3 additions & 3 deletions src/session.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use enumflags2::{bitflags, BitFlags};
use zbus::{interface, zvariant::OwnedObjectPath, SignalContext};
use zbus::{interface, object_server::SignalEmitter, zvariant::OwnedObjectPath};

use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};
Expand Down Expand Up @@ -156,7 +156,7 @@ impl Session {
impl Session {
async fn close(
&self,
#[zbus(signal_context)] cxts: SignalContext<'_>,
#[zbus(signal_emitter)] cxts: SignalEmitter<'_>,
#[zbus(object_server)] server: &zbus::ObjectServer,
) -> zbus::fdo::Result<()> {
server
Expand All @@ -173,5 +173,5 @@ impl Session {
}

#[zbus(signal)]
async fn closed(signal_ctxt: &SignalContext<'_>, message: &str) -> zbus::Result<()>;
async fn closed(signal_ctxt: &SignalEmitter<'_>, message: &str) -> zbus::Result<()>;
}
4 changes: 2 additions & 2 deletions src/settings.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mod config;
use tokio::sync::Mutex;
use zbus::{fdo, interface, SignalContext};
use zbus::{fdo, interface, object_server::SignalEmitter};

use zbus::zvariant::{DeserializeDict, OwnedValue, SerializeDict, Type, Value};

Expand Down Expand Up @@ -80,7 +80,7 @@ impl SettingsBackend {

#[zbus(signal)]
pub async fn setting_changed(
ctxt: &SignalContext<'_>,
ctxt: &SignalEmitter<'_>,
namespace: String,
key: String,
value: OwnedValue,
Expand Down

0 comments on commit 4e3ca09

Please sign in to comment.