Refresh gvfs volumes as needed

This commit is contained in:
Jeremy Soller 2024-04-22 13:14:25 -06:00
parent 02b6cda872
commit 2b1abc7c23
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
4 changed files with 342 additions and 88 deletions

View file

@ -4,22 +4,36 @@ fn main() {
let monitor = gio::VolumeMonitor::get();
for drive in monitor.connected_drives() {
println!("Drive: {}", drive.name());
for id in drive.enumerate_identifiers() {
println!(" ID: {}={:?}", id, drive.identifier(&id));
}
for volume in drive.volumes() {
println!(" Volume: {}", volume.name());
println!(" UUID: {:?}", volume.uuid());
for id in volume.enumerate_identifiers() {
println!(" ID: {}={:?}", id, volume.identifier(&id));
}
if let Some(mount) = volume.get_mount() {
println!(" Mount: {}", mount.name());
println!(" UUID: {:?}", mount.uuid());
}
}
}
for mount in monitor.mounts() {
println!("Mount: {}", mount.name());
println!(" UUID: {:?}", mount.uuid());
}
for volume in monitor.volumes() {
println!("Volume: {}", volume.name());
println!(" UUID: {:?}", volume.uuid());
for id in volume.enumerate_identifiers() {
println!(" ID: {}={:?}", id, volume.identifier(&id));
}
if let Some(mount) = volume.get_mount() {
println!(" Mount: {}", mount.name());
println!(" UUID: {:?}", mount.uuid());
}
}
}