fix(networkmanager): Device::available_connections returns Settings objects

This commit is contained in:
Michael Aaron Murphy 2024-08-28 16:24:11 +02:00
parent cd21ddcb1b
commit 64f4000374
No known key found for this signature in database
GPG key ID: B2732D4240C9212C

View file

@ -17,7 +17,9 @@ use crate::{
wireguard::WireGuardDeviceProxy, wireless::WirelessDeviceProxy, DeviceProxy, wireguard::WireGuardDeviceProxy, wireless::WirelessDeviceProxy, DeviceProxy,
}, },
enums::{DeviceCapabilities, DeviceState, DeviceType}, enums::{DeviceCapabilities, DeviceState, DeviceType},
settings::connection::ConnectionSettingsProxy,
}, },
settings::connection::Connection,
}; };
use std::{net::Ipv4Addr, ops::Deref}; use std::{net::Ipv4Addr, ops::Deref};
use zbus::Result; use zbus::Result;
@ -35,11 +37,11 @@ impl<'a> Device<'a> {
.into()) .into())
} }
pub async fn available_connections(&self) -> Result<Vec<ActiveConnection<'a>>> { pub async fn available_connections(&self) -> Result<Vec<Connection<'a>>> {
let available_connections = self.0.available_connections().await?; let available_connections = self.0.available_connections().await?;
let mut out = Vec::with_capacity(available_connections.len()); let mut out = Vec::with_capacity(available_connections.len());
for connection in available_connections { for connection in available_connections {
let connection = ActiveConnectionProxy::builder(self.0.inner().connection()) let connection = ConnectionSettingsProxy::builder(self.0.inner().connection())
.path(connection)? .path(connection)?
.build() .build()
.await?; .await?;