mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-09-18 12:46:58 +02:00
fix(networkmanager): remove icons for removed devices
This commit is contained in:
parent
d752e88abf
commit
af49acb40b
2 changed files with 20 additions and 3 deletions
|
@ -113,7 +113,6 @@ impl ClientInner {
|
|||
watchers.insert(added_device_path.clone(), watcher);
|
||||
}
|
||||
|
||||
// TODO: Inform module of removed devices
|
||||
let removed_device_paths = device_paths.difference(&new_device_paths);
|
||||
for removed_device_path in removed_device_paths {
|
||||
let watcher = watchers
|
||||
|
@ -122,6 +121,13 @@ impl ClientInner {
|
|||
watcher.state_watcher.abort();
|
||||
watchers.remove(removed_device_path);
|
||||
|
||||
// TODO: Replace the identifier sent to modules with the dbus device number (last segment of its path)
|
||||
let dbus_connection = &self.dbus_connection().await?;
|
||||
let device = DeviceDbusProxy::new(dbus_connection, removed_device_path).await?;
|
||||
let interface = device.interface().await?.to_string();
|
||||
self.controller_sender
|
||||
.send(ClientToModuleEvent::DeviceRemoved { interface })?;
|
||||
|
||||
debug!("D-bus device watchers for {} stopped", removed_device_path);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue