Skip to content

Commit

Permalink
fix: use new interface
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanabx committed Apr 27, 2024
1 parent 7cd1187 commit 0068744
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
29 changes: 15 additions & 14 deletions src/desktop_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
//! This type implements the [D-Bus standard interfaces], (`org.freedesktop.DBus.*`) for which the
//! following zbus API can be used:
//!
//! * [`zbus::fdo::IntrospectableProxy`]
//! * [`zbus::fdo::PropertiesProxy`]
//! * [`zbus::fdo::PeerProxy`]
//! * [`zbus::fdo::PropertiesProxy`]
//! * [`zbus::fdo::IntrospectableProxy`]
//!
//! Consequently `zbus-xmlgen` did not generate code for the above interfaces.
//!
Expand All @@ -26,20 +26,21 @@ use zbus::proxy;
assume_defaults = true
)]
trait DesktopEntry {
/// RegisterChangeHandler method
fn register_change_handler(&self, pid: u32) -> zbus::Result<()>;
/// NewPersistentEntry method
fn new_persistent_entry(&self, appid: &str, entry: &str) -> zbus::Result<()>;

/// NewPersistentIcon method
fn new_persistent_icon(&self, name: &str, data: &[u8]) -> zbus::Result<()>;

/// RegisterEntry method
fn register_entry(&self, appid: &str, entry: &str) -> zbus::Result<()>;
/// NewProcessEntry method
fn new_process_entry(&self, appid: &str, entry: &str) -> zbus::Result<()>;

/// RegisterIcon method
fn register_icon(&self, name: &str, data: &[u8]) -> zbus::Result<()>;
/// NewProcessIcon method
fn new_process_icon(&self, name: &str, data: &[u8]) -> zbus::Result<()>;

/// EntryChanged signal
#[zbus(signal)]
fn entry_changed(&self, appid: &str) -> zbus::Result<()>;
/// NewSessionEntry method
fn new_session_entry(&self, appid: &str, entry: &str) -> zbus::Result<()>;

/// IconChanged signal
#[zbus(signal)]
fn icon_changed(&self, icon_name: &str) -> zbus::Result<()>;
/// NewSessionIcon method
fn new_session_icon(&self, name: &str, data: &[u8]) -> zbus::Result<()>;
}
4 changes: 2 additions & 2 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ async fn set_up_client(
continue; // We don't want to push NoDisplay entries into our host
}

match proxy.register_entry(&entry.appid, &file_text).await {
match proxy.new_session_entry(&entry.appid, &file_text).await {
Ok(_) => {
log::info!("Daemon registered entry: {}", entry.appid);
if let Some(icon_name) = entry.icon() {
Expand All @@ -173,7 +173,7 @@ async fn set_up_client(
Some("png" | "svg") => {
let file_bytes = read(icon_path).unwrap();
match proxy
.register_icon(icon_name, file_bytes.as_slice())
.new_session_icon(icon_name, file_bytes.as_slice())
.await
{
Ok(_) => {
Expand Down

0 comments on commit 0068744

Please sign in to comment.