Skip to content

Commit

Permalink
chore: Change back accesspointchanged..
Browse files Browse the repository at this point in the history
  • Loading branch information
DashieTM committed Nov 22, 2023
1 parent 95ff7ff commit c5b8807
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ReSet-Lib"
version = "0.4.4"
version = "0.4.5"
edition = "2021"
description = "Data structure library for ReSet"
repository = "https://github.com/Xetibo/ReSet-Lib"
Expand Down
24 changes: 7 additions & 17 deletions src/signals.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
use dbus::{
arg::{self, PropMap, RefArg, Variant},
Path,
};
use dbus::{arg, Path};

use crate::{bluetooth::bluetooth::BluetoothDevice, network::network::AccessPoint};

Expand Down Expand Up @@ -101,22 +98,19 @@ impl GetVal<(AccessPoint,)> for AccessPointAdded {

#[derive(Debug)]
pub struct AccessPointChanged {
pub path: Path<'static>,
pub map: PropMap,
pub access_point: AccessPoint,
}

impl arg::AppendAll for AccessPointChanged {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.path, i);
arg::RefArg::append(&self.map, i);
arg::RefArg::append(&self.access_point, i);
}
}

impl arg::ReadAll for AccessPointChanged {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(AccessPointChanged {
path: i.read()?,
map: i.read()?,
access_point: i.read()?,
})
}
}
Expand All @@ -126,13 +120,9 @@ impl dbus::message::SignalArgs for AccessPointChanged {
const INTERFACE: &'static str = "org.xetibo.ReSet";
}

impl GetVal<(Path<'static>, PropMap)> for AccessPointChanged {
fn get_value(&self) -> (Path<'static>, PropMap) {
let mut map = PropMap::new();
for (key, value) in self.map.iter() {
map.insert(key.clone(), Variant(value.box_clone()));
}
(self.path.clone(), map)
impl GetVal<(AccessPoint,)> for AccessPointChanged {
fn get_value(&self) -> (AccessPoint,) {
(self.access_point.clone(),)
}
}

Expand Down

0 comments on commit c5b8807

Please sign in to comment.