Fall back to unmount if eject is not supported, fixes #941
This commit is contained in:
parent
08f0cab550
commit
7598130650
1 changed files with 23 additions and 10 deletions
|
|
@ -428,16 +428,29 @@ impl Gvfs {
|
|||
continue;
|
||||
}
|
||||
|
||||
log::info!("unmount {}", name);
|
||||
MountExt::eject_with_operation(
|
||||
&mount,
|
||||
gio::MountUnmountFlags::NONE,
|
||||
gio::MountOperation::NONE,
|
||||
gio::Cancellable::NONE,
|
||||
move |result| {
|
||||
log::info!("unmount {}: result {:?}", name, result);
|
||||
},
|
||||
);
|
||||
if MountExt::can_eject(&mount) {
|
||||
log::info!("eject {}", name);
|
||||
MountExt::eject_with_operation(
|
||||
&mount,
|
||||
gio::MountUnmountFlags::NONE,
|
||||
gio::MountOperation::NONE,
|
||||
gio::Cancellable::NONE,
|
||||
move |result| {
|
||||
log::info!("eject {}: result {:?}", name, result);
|
||||
},
|
||||
);
|
||||
} else {
|
||||
log::info!("unmount {}", name);
|
||||
MountExt::unmount_with_operation(
|
||||
&mount,
|
||||
gio::MountUnmountFlags::NONE,
|
||||
gio::MountOperation::NONE,
|
||||
gio::Cancellable::NONE,
|
||||
move |result| {
|
||||
log::info!("unmount {}: result {:?}", name, result);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue