Add local and remote favorites

This commit is contained in:
burnintuna 2026-07-22 01:24:37 +09:00
parent 5f9b5d9796
commit 490c925f62
4 changed files with 357 additions and 28 deletions

View file

@ -177,6 +177,26 @@ pub fn mount_operation(
operation
}
pub async fn ensure_mounted(
file: &gio::File,
profile: &LocationProfile,
operation: &gtk::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: &gtk::MountOperation,