Add local and remote favorites
This commit is contained in:
parent
5f9b5d9796
commit
490c925f62
4 changed files with 357 additions and 28 deletions
|
|
@ -177,6 +177,26 @@ pub fn mount_operation(
|
|||
operation
|
||||
}
|
||||
|
||||
pub async fn ensure_mounted(
|
||||
file: &gio::File,
|
||||
profile: &LocationProfile,
|
||||
operation: >k::MountOperation,
|
||||
) -> Result<()> {
|
||||
if profile.kind == LocationKind::Local || file.is_native() {
|
||||
return Ok(());
|
||||
}
|
||||
match file
|
||||
.mount_enclosing_volume_future(gio::MountMountFlags::NONE, Some(operation))
|
||||
.await
|
||||
{
|
||||
Ok(()) => Ok(()),
|
||||
Err(error) if error.matches(gio::IOErrorEnum::AlreadyMounted) => Ok(()),
|
||||
Err(error) => {
|
||||
Err(error).with_context(|| format!("원격 위치를 마운트할 수 없습니다: {}", file.uri()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async fn enumerate_with_mount_retry(
|
||||
directory: &gio::File,
|
||||
operation: >k::MountOperation,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue