280 feature request go to path auto completion (#287)

This commit is contained in:
Christian Visintin
2024-10-03 17:11:25 +02:00
committed by GitHub
parent 8e2ffeabce
commit 3f01be3baa
11 changed files with 509 additions and 92 deletions

View File

@@ -27,6 +27,7 @@ pub(crate) mod open;
mod pending;
pub(crate) mod rename;
pub(crate) mod save;
pub(crate) mod scan;
pub(crate) mod submit;
pub(crate) mod symlink;
pub(crate) mod walkdir;

View File

@@ -0,0 +1,19 @@
use std::path::Path;
use super::{File, FileTransferActivity};
use crate::ui::activities::filetransfer::lib::browser::FileExplorerTab;
impl FileTransferActivity {
pub(crate) fn action_scan(&mut self, p: &Path) -> Result<Vec<File>, String> {
match self.browser.tab() {
FileExplorerTab::Local | FileExplorerTab::FindLocal => self
.host
.list_dir(p)
.map_err(|e| format!("Failed to list directory: {}", e)),
FileExplorerTab::Remote | FileExplorerTab::FindRemote => self
.client
.list_dir(p)
.map_err(|e| format!("Failed to list directory: {}", e)),
}
}
}