mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-12-15 10:01:39 +01:00
chore: Code cleanup
This commit is contained in:
parent
f8c27fd498
commit
921d5e7fe6
27 changed files with 304 additions and 234 deletions
|
|
@ -1,11 +1,14 @@
|
|||
use std::collections::HashMap;
|
||||
use std::time::Duration;
|
||||
use dbus::arg::{RefArg};
|
||||
use dbus::arg::RefArg;
|
||||
use dbus::blocking::Connection;
|
||||
use dbus::Error;
|
||||
use dbus::Path;
|
||||
use std::collections::HashMap;
|
||||
use std::time::Duration;
|
||||
use ReSet_Lib::network::connection::Connection as ResetConnection;
|
||||
|
||||
type ResultType =
|
||||
Result<(HashMap<String, HashMap<String, dbus::arg::Variant<Box<dyn RefArg>>>>,), Error>;
|
||||
|
||||
pub fn getConnectionSettings(path: Path<'static>) -> ResetConnection {
|
||||
let conn = Connection::new_session().unwrap();
|
||||
let proxy = conn.with_proxy(
|
||||
|
|
@ -13,10 +16,8 @@ pub fn getConnectionSettings(path: Path<'static>) -> ResetConnection {
|
|||
"/org/Xetibo/ReSetDaemon",
|
||||
Duration::from_millis(1000),
|
||||
);
|
||||
let res: Result<
|
||||
(HashMap<String, HashMap<String, dbus::arg::Variant<Box<dyn RefArg>>>>,),
|
||||
Error,
|
||||
> = proxy.method_call("org.xetibo.ReSetWireless", "GetConnectionSettings", (path,));
|
||||
let res: ResultType =
|
||||
proxy.method_call("org.xetibo.ReSetWireless", "GetConnectionSettings", (path,));
|
||||
if res.is_err() {
|
||||
ResetConnection::default();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue