save local file paths in bookmark (#204)

* fix: renamed Bookmark 'directory' to 'remote_path' (keep name in file)

* feat: local_path as file transfer parameter and in bookmark
This commit is contained in:
Christian Visintin
2023-07-06 16:05:22 +02:00
committed by GitHub
parent ee28d34f29
commit ca005cbecd
16 changed files with 261 additions and 98 deletions

View File

@@ -220,7 +220,7 @@ pub struct FileTransferActivity {
cache: Option<TempDir>,
/// Fs watcher
fswatcher: Option<FsWatcher>,
/// conncted once
/// connected once
connected: bool,
}

View File

@@ -53,7 +53,7 @@ impl FileTransferActivity {
/// Connect to remote
pub(super) fn connect(&mut self) {
let ft_params = self.context().ft_params().unwrap().clone();
let entry_dir: Option<PathBuf> = ft_params.entry_directory;
let entry_dir: Option<PathBuf> = ft_params.remote_path;
// Connect to remote
match self.client.connect() {
Ok(Welcome { banner, .. }) => {
@@ -71,11 +71,11 @@ impl FileTransferActivity {
}
// Try to change directory to entry directory
let mut remote_chdir: Option<PathBuf> = None;
if let Some(entry_directory) = &entry_dir {
remote_chdir = Some(entry_directory.clone());
if let Some(remote_path) = &entry_dir {
remote_chdir = Some(remote_path.clone());
}
if let Some(entry_directory) = remote_chdir {
self.remote_changedir(entry_directory.as_path(), false);
if let Some(remote_path) = remote_chdir {
self.remote_changedir(remote_path.as_path(), false);
}
// Set state to explorer
self.umount_wait();