This commit is contained in:
veeso
2021-08-10 22:27:20 +02:00
parent 6cfac57162
commit 764cca73d1
19 changed files with 104 additions and 100 deletions

View File

@@ -44,7 +44,7 @@ impl AuthActivity {
// Iterate over kyes
let name: Option<&String> = self.bookmarks_list.get(idx);
if let Some(name) = name {
bookmarks_cli.del_bookmark(&name);
bookmarks_cli.del_bookmark(name);
// Write bookmarks
self.write_bookmarks();
}
@@ -60,7 +60,7 @@ impl AuthActivity {
if let Some(bookmarks_cli) = self.bookmarks_client.as_ref() {
// Iterate over bookmarks
if let Some(key) = self.bookmarks_list.get(idx) {
if let Some(bookmark) = bookmarks_cli.get_bookmark(&key) {
if let Some(bookmark) = bookmarks_cli.get_bookmark(key) {
// Load parameters into components
self.load_bookmark_into_gui(
bookmark.0, bookmark.1, bookmark.2, bookmark.3, bookmark.4,
@@ -104,7 +104,7 @@ impl AuthActivity {
if let Some(client) = self.bookmarks_client.as_mut() {
let name: Option<&String> = self.recents_list.get(idx);
if let Some(name) = name {
client.del_recent(&name);
client.del_recent(name);
// Write bookmarks
self.write_bookmarks();
}

View File

@@ -72,7 +72,7 @@ impl FileTransferActivity {
}
pub(crate) fn local_remove_file(&mut self, entry: &FsEntry) {
match self.host.remove(&entry) {
match self.host.remove(entry) {
Ok(_) => {
// Log
self.log(
@@ -94,7 +94,7 @@ impl FileTransferActivity {
}
pub(crate) fn remote_remove_file(&mut self, entry: &FsEntry) {
match self.client.remove(&entry) {
match self.client.remove(entry) {
Ok(_) => {
self.log(
LogLevel::Info,

View File

@@ -142,7 +142,7 @@ impl Browser {
let mut builder: FileExplorerBuilder = FileExplorerBuilder::new();
// Set common keys
builder
.with_file_sorting(FileSorting::ByName)
.with_file_sorting(FileSorting::Name)
.with_stack_size(16)
.with_group_dirs(cli.get_group_dirs())
.with_hidden_files(cli.get_show_hidden_files());
@@ -154,7 +154,7 @@ impl Browser {
/// Build explorer reading from `ConfigClient`, for found result (has some differences)
fn build_found_explorer() -> FileExplorer {
FileExplorerBuilder::new()
.with_file_sorting(FileSorting::ByName)
.with_file_sorting(FileSorting::Name)
.with_group_dirs(Some(GroupDirs::First))
.with_hidden_files(true)
.with_stack_size(0)

View File

@@ -228,7 +228,7 @@ impl FileTransferActivity {
///
/// Returns config client reference
fn config(&self) -> &ConfigClient {
&self.context().config()
self.context().config()
}
/// ### theme

View File

@@ -381,7 +381,7 @@ impl FileTransferActivity {
}
// Send entry; name is always None after first call
self.filetransfer_send_recurse(
&entry,
entry,
remote_path.as_path(),
None,
);
@@ -730,7 +730,7 @@ impl FileTransferActivity {
// Receive entry; name is always None after first call
// Local path becomes local_dir_path
self.filetransfer_recv_recurse(
&entry,
entry,
local_dir_path.as_path(),
None,
);

View File

@@ -663,10 +663,10 @@ impl Update for FileTransferActivity {
(COMPONENT_RADIO_SORTING, Msg::OnChange(Payload::One(Value::Usize(mode)))) => {
// Get sorting mode
let sorting: FileSorting = match mode {
1 => FileSorting::ByModifyTime,
2 => FileSorting::ByCreationTime,
3 => FileSorting::BySize,
_ => FileSorting::ByName,
1 => FileSorting::ModifyTime,
2 => FileSorting::CreationTime,
3 => FileSorting::Size,
_ => FileSorting::Name,
};
match self.browser.tab() {
FileExplorerTab::Local => self.local_mut().sort_by(sorting),

View File

@@ -770,10 +770,10 @@ impl FileTransferActivity {
_ => panic!("You can't mount file sorting when in found result"),
};
let index: usize = match sorting {
FileSorting::ByCreationTime => 2,
FileSorting::ByModifyTime => 1,
FileSorting::ByName => 0,
FileSorting::BySize => 3,
FileSorting::CreationTime => 2,
FileSorting::ModifyTime => 1,
FileSorting::Name => 0,
FileSorting::Size => 3,
};
self.view.mount(
super::COMPONENT_RADIO_SORTING,
@@ -1280,10 +1280,10 @@ impl FileTransferActivity {
fn get_file_sorting_str(mode: FileSorting) -> &'static str {
match mode {
FileSorting::ByName => "By name",
FileSorting::ByCreationTime => "By creation time",
FileSorting::ByModifyTime => "By modify time",
FileSorting::BySize => "By size",
FileSorting::Name => "By name",
FileSorting::CreationTime => "By creation time",
FileSorting::ModifyTime => "By modify time",
FileSorting::Size => "By size",
}
}

View File

@@ -152,7 +152,7 @@ impl SetupActivity {
}
fn config(&self) -> &ConfigClient {
&self.context().config()
self.context().config()
}
fn config_mut(&mut self) -> &mut ConfigClient {