build(deps): updated dependencies and edition to 2024

This commit is contained in:
veeso
2025-03-15 14:15:45 +01:00
parent 8a9ba7745a
commit b0f314837e
46 changed files with 3621 additions and 2835 deletions
@@ -167,7 +167,9 @@ impl FileTransferActivity {
}
} else {
// Do not synchronize, disable sync browsing and return
trace!("The user doesn't want to create the directory; disabling synchronized browsing");
trace!(
"The user doesn't want to create the directory; disabling synchronized browsing"
);
self.log(
LogLevel::Warn,
format!("Refused to create '{name}'; synchronized browsing disabled"),
@@ -7,8 +7,8 @@ use std::io::Read;
use std::path::{Path, PathBuf};
use std::time::SystemTime;
use remotefs::fs::Metadata;
use remotefs::File;
use remotefs::fs::Metadata;
use super::{FileTransferActivity, LogLevel, SelectedFile, TransferPayload};
@@ -221,10 +221,7 @@ impl FileTransferActivity {
/// Edit file on remote host
fn edit_remote_file(&mut self, file: File) -> Result<(), String> {
// Create temp file
let tmpfile: PathBuf = match self.download_file_as_temp(&file) {
Ok(p) => p,
Err(err) => return Err(err),
};
let tmpfile = self.download_file_as_temp(&file)?;
// Download file
let file_name = file.name();
let file_path = file.path().to_path_buf();
@@ -243,7 +240,7 @@ impl FileTransferActivity {
"Could not stat \"{}\": {}",
tmpfile.as_path().display(),
err
))
));
}
};
// Edit file
@@ -256,7 +253,7 @@ impl FileTransferActivity {
"Could not stat \"{}\": {}",
tmpfile.as_path().display(),
err
))
));
}
};
// Check if file has changed
@@ -282,7 +279,7 @@ impl FileTransferActivity {
"Could not stat \"{}\": {}",
tmpfile.as_path().display(),
err
))
));
}
};
// Send file
@@ -4,8 +4,8 @@ use regex::Regex;
use remotefs::File;
use wildmatch::WildMatch;
use crate::ui::activities::filetransfer::lib::browser::FileExplorerTab;
use crate::ui::activities::filetransfer::FileTransferActivity;
use crate::ui::activities::filetransfer::lib::browser::FileExplorerTab;
#[derive(Clone, Debug)]
pub enum Filter {
@@ -2,8 +2,8 @@
//!
//! `filetransfer_activiy` is the module which implements the Filetransfer activity, which is the main activity afterall
use remotefs::fs::UnixPex;
use remotefs::File;
use remotefs::fs::UnixPex;
use tuirealm::{State, StateValue};
use super::browser::FileExplorerTab;
@@ -16,12 +16,12 @@ mod transfer;
pub use misc::FooterBar;
pub use popups::{
ChmodPopup, CopyPopup, DeletePopup, DisconnectPopup, ErrorPopup, ExecPopup, FatalPopup,
FileInfoPopup, FilterPopup, GotoPopup, KeybindingsPopup, MkdirPopup, NewfilePopup,
ATTR_FILES, ChmodPopup, CopyPopup, DeletePopup, DisconnectPopup, ErrorPopup, ExecPopup,
FatalPopup, FileInfoPopup, FilterPopup, GotoPopup, KeybindingsPopup, MkdirPopup, NewfilePopup,
OpenWithPopup, ProgressBarFull, ProgressBarPartial, QuitPopup, RenamePopup, ReplacePopup,
ReplacingFilesListPopup, SaveAsPopup, SortingPopup, StatusBarLocal, StatusBarRemote,
SymlinkPopup, SyncBrowsingMkdirPopup, WaitPopup, WalkdirWaitPopup, WatchedPathsList,
WatcherPopup, ATTR_FILES,
WatcherPopup,
};
pub use transfer::{ExplorerFind, ExplorerFuzzy, ExplorerLocal, ExplorerRemote};
@@ -20,7 +20,7 @@ use tuirealm::{Component, Event, MockComponent, NoUserEvent, State, StateValue};
use uzers::{get_group_by_gid, get_user_by_uid};
pub use self::chmod::ChmodPopup;
pub use self::goto::{GotoPopup, ATTR_FILES};
pub use self::goto::{ATTR_FILES, GotoPopup};
use super::super::Browser;
use super::{Msg, PendingActionMsg, TransferMsg, UiMsg};
use crate::explorer::FileSorting;
+106 -93
View File
@@ -90,7 +90,9 @@ impl FileTransferActivity {
/// Set text editor to use
pub(super) fn setup_text_editor(&self) {
env::set_var("EDITOR", self.config().get_text_editor());
unsafe {
env::set_var("EDITOR", self.config().get_text_editor());
}
}
/// Convert a path to absolute according to host explorer
@@ -262,22 +264,24 @@ impl FileTransferActivity {
.map(|x| vec![TextSpan::from(self.host_bridge().fmt_file(x))])
.collect();
// Update content and title
assert!(self
.app
.attr(
&Id::ExplorerHostBridge,
Attribute::Content,
AttrValue::Table(files)
)
.is_ok());
assert!(self
.app
.attr(
&Id::ExplorerHostBridge,
Attribute::Title,
AttrValue::Title((hostname, Alignment::Left))
)
.is_ok());
assert!(
self.app
.attr(
&Id::ExplorerHostBridge,
Attribute::Content,
AttrValue::Table(files)
)
.is_ok()
);
assert!(
self.app
.attr(
&Id::ExplorerHostBridge,
Attribute::Title,
AttrValue::Title((hostname, Alignment::Left))
)
.is_ok()
);
}
/// Update remote file list
@@ -307,22 +311,24 @@ impl FileTransferActivity {
.map(|x| vec![TextSpan::from(self.remote().fmt_file(x))])
.collect();
// Update content and title
assert!(self
.app
.attr(
&Id::ExplorerRemote,
Attribute::Content,
AttrValue::Table(files)
)
.is_ok());
assert!(self
.app
.attr(
&Id::ExplorerRemote,
Attribute::Title,
AttrValue::Title((hostname, Alignment::Left))
)
.is_ok());
assert!(
self.app
.attr(
&Id::ExplorerRemote,
Attribute::Content,
AttrValue::Table(files)
)
.is_ok()
);
assert!(
self.app
.attr(
&Id::ExplorerRemote,
Attribute::Title,
AttrValue::Title((hostname, Alignment::Left))
)
.is_ok()
);
}
/// Update log box
@@ -361,61 +367,67 @@ impl FileTransferActivity {
.add_col(TextSpan::from("]: "))
.add_col(TextSpan::from(record.msg.as_str()));
}
assert!(self
.app
.attr(
&Id::Log,
Attribute::Content,
AttrValue::Table(table.build())
)
.is_ok());
assert!(
self.app
.attr(
&Id::Log,
Attribute::Content,
AttrValue::Table(table.build())
)
.is_ok()
);
}
pub(super) fn update_progress_bar(&mut self, filename: String) {
assert!(self
.app
.attr(
&Id::ProgressBarFull,
Attribute::Text,
AttrValue::String(self.transfer.full.to_string())
)
.is_ok());
assert!(self
.app
.attr(
&Id::ProgressBarFull,
Attribute::Value,
AttrValue::Payload(PropPayload::One(PropValue::F64(
self.transfer.full.calc_progress()
)))
)
.is_ok());
assert!(self
.app
.attr(
&Id::ProgressBarPartial,
Attribute::Text,
AttrValue::String(self.transfer.partial.to_string())
)
.is_ok());
assert!(self
.app
.attr(
&Id::ProgressBarPartial,
Attribute::Value,
AttrValue::Payload(PropPayload::One(PropValue::F64(
self.transfer.partial.calc_progress()
)))
)
.is_ok());
assert!(self
.app
.attr(
&Id::ProgressBarPartial,
Attribute::Title,
AttrValue::Title((filename, Alignment::Center))
)
.is_ok());
assert!(
self.app
.attr(
&Id::ProgressBarFull,
Attribute::Text,
AttrValue::String(self.transfer.full.to_string())
)
.is_ok()
);
assert!(
self.app
.attr(
&Id::ProgressBarFull,
Attribute::Value,
AttrValue::Payload(PropPayload::One(PropValue::F64(
self.transfer.full.calc_progress()
)))
)
.is_ok()
);
assert!(
self.app
.attr(
&Id::ProgressBarPartial,
Attribute::Text,
AttrValue::String(self.transfer.partial.to_string())
)
.is_ok()
);
assert!(
self.app
.attr(
&Id::ProgressBarPartial,
Attribute::Value,
AttrValue::Payload(PropPayload::One(PropValue::F64(
self.transfer.partial.calc_progress()
)))
)
.is_ok()
);
assert!(
self.app
.attr(
&Id::ProgressBarPartial,
Attribute::Title,
AttrValue::Title((filename, Alignment::Center))
)
.is_ok()
);
}
/// Finalize find process
@@ -450,14 +462,15 @@ impl FileTransferActivity {
.iter_files()
.map(|x| vec![TextSpan::from(self.found().unwrap().fmt_file(x))])
.collect();
assert!(self
.app
.attr(
&Id::ExplorerFind,
Attribute::Content,
AttrValue::Table(files)
)
.is_ok());
assert!(
self.app
.attr(
&Id::ExplorerFind,
Attribute::Content,
AttrValue::Table(files)
)
.is_ok()
);
}
pub(super) fn update_browser_file_list(&mut self) {
+1 -1
View File
@@ -28,7 +28,7 @@ use session::TransferPayload;
use tempfile::TempDir;
use tuirealm::{Application, EventListenerCfg, NoUserEvent};
use super::{Activity, Context, ExitReason, CROSSTERM_MAX_POLL};
use super::{Activity, CROSSTERM_MAX_POLL, Context, ExitReason};
use crate::config::themes::Theme;
use crate::explorer::{FileExplorer, FileSorting};
use crate::filetransfer::{
+1 -1
View File
@@ -1239,7 +1239,7 @@ impl FileTransferActivity {
None => {
return Err(String::from(
"Could not create tempfile: cache not available",
))
));
}
};
// Download file
+1 -1
View File
@@ -8,8 +8,8 @@ use remotefs::fs::File;
use tuirealm::props::{AttrValue, Attribute};
use tuirealm::{State, StateValue, Update};
use super::actions::walkdir::WalkdirError;
use super::actions::SelectedFile;
use super::actions::walkdir::WalkdirError;
use super::browser::{FileExplorerTab, FoundExplorerTab};
use super::{ExitReason, FileTransferActivity, Id, Msg, TransferMsg, TransferOpts, UiMsg};
File diff suppressed because it is too large Load Diff