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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
log::info!("unmount {}", name);
|
if MountExt::can_eject(&mount) {
|
||||||
MountExt::eject_with_operation(
|
log::info!("eject {}", name);
|
||||||
&mount,
|
MountExt::eject_with_operation(
|
||||||
gio::MountUnmountFlags::NONE,
|
&mount,
|
||||||
gio::MountOperation::NONE,
|
gio::MountUnmountFlags::NONE,
|
||||||
gio::Cancellable::NONE,
|
gio::MountOperation::NONE,
|
||||||
move |result| {
|
gio::Cancellable::NONE,
|
||||||
log::info!("unmount {}: result {:?}", name, result);
|
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