Disable sync browsing when found explorer is mounted

This commit is contained in:
veeso
2021-12-12 20:44:56 +01:00
committed by Christian Visintin
parent 54c23079be
commit 197b3095b6
2 changed files with 15 additions and 15 deletions

View File

@@ -42,7 +42,7 @@ impl FileTransferActivity {
/// Enter a directory on local host from entry /// Enter a directory on local host from entry
pub(crate) fn action_enter_local_dir(&mut self, dir: Directory) { pub(crate) fn action_enter_local_dir(&mut self, dir: Directory) {
self.local_changedir(dir.path.as_path(), true); self.local_changedir(dir.path.as_path(), true);
if self.browser.sync_browsing { if self.browser.sync_browsing && self.browser.found().is_none() {
self.synchronize_browsing(SyncBrowsingDestination::Path(dir.name)); self.synchronize_browsing(SyncBrowsingDestination::Path(dir.name));
} }
} }
@@ -50,7 +50,7 @@ impl FileTransferActivity {
/// Enter a directory on local host from entry /// Enter a directory on local host from entry
pub(crate) fn action_enter_remote_dir(&mut self, dir: Directory) { pub(crate) fn action_enter_remote_dir(&mut self, dir: Directory) {
self.remote_changedir(dir.path.as_path(), true); self.remote_changedir(dir.path.as_path(), true);
if self.browser.sync_browsing { if self.browser.sync_browsing && self.browser.found().is_none() {
self.synchronize_browsing(SyncBrowsingDestination::Path(dir.name)); self.synchronize_browsing(SyncBrowsingDestination::Path(dir.name));
} }
} }
@@ -60,7 +60,7 @@ impl FileTransferActivity {
let dir_path: PathBuf = self.local_to_abs_path(PathBuf::from(input.as_str()).as_path()); let dir_path: PathBuf = self.local_to_abs_path(PathBuf::from(input.as_str()).as_path());
self.local_changedir(dir_path.as_path(), true); self.local_changedir(dir_path.as_path(), true);
// Check whether to sync // Check whether to sync
if self.browser.sync_browsing { if self.browser.sync_browsing && self.browser.found().is_none() {
self.synchronize_browsing(SyncBrowsingDestination::Path(input)); self.synchronize_browsing(SyncBrowsingDestination::Path(input));
} }
} }
@@ -70,7 +70,7 @@ impl FileTransferActivity {
let dir_path: PathBuf = self.remote_to_abs_path(PathBuf::from(input.as_str()).as_path()); let dir_path: PathBuf = self.remote_to_abs_path(PathBuf::from(input.as_str()).as_path());
self.remote_changedir(dir_path.as_path(), true); self.remote_changedir(dir_path.as_path(), true);
// Check whether to sync // Check whether to sync
if self.browser.sync_browsing { if self.browser.sync_browsing && self.browser.found().is_none() {
self.synchronize_browsing(SyncBrowsingDestination::Path(input)); self.synchronize_browsing(SyncBrowsingDestination::Path(input));
} }
} }
@@ -80,7 +80,7 @@ impl FileTransferActivity {
if let Some(d) = self.local_mut().popd() { if let Some(d) = self.local_mut().popd() {
self.local_changedir(d.as_path(), false); self.local_changedir(d.as_path(), false);
// Check whether to sync // Check whether to sync
if self.browser.sync_browsing { if self.browser.sync_browsing && self.browser.found().is_none() {
self.synchronize_browsing(SyncBrowsingDestination::PreviousDir); self.synchronize_browsing(SyncBrowsingDestination::PreviousDir);
} }
} }
@@ -91,7 +91,7 @@ impl FileTransferActivity {
if let Some(d) = self.remote_mut().popd() { if let Some(d) = self.remote_mut().popd() {
self.remote_changedir(d.as_path(), false); self.remote_changedir(d.as_path(), false);
// Check whether to sync // Check whether to sync
if self.browser.sync_browsing { if self.browser.sync_browsing && self.browser.found().is_none() {
self.synchronize_browsing(SyncBrowsingDestination::PreviousDir); self.synchronize_browsing(SyncBrowsingDestination::PreviousDir);
} }
} }
@@ -105,7 +105,7 @@ impl FileTransferActivity {
if let Some(parent) = path.as_path().parent() { if let Some(parent) = path.as_path().parent() {
self.local_changedir(parent, true); self.local_changedir(parent, true);
// If sync is enabled update remote too // If sync is enabled update remote too
if self.browser.sync_browsing { if self.browser.sync_browsing && self.browser.found().is_none() {
self.synchronize_browsing(SyncBrowsingDestination::ParentDir); self.synchronize_browsing(SyncBrowsingDestination::ParentDir);
} }
} }
@@ -121,7 +121,7 @@ impl FileTransferActivity {
if let Some(parent) = path.as_path().parent() { if let Some(parent) = path.as_path().parent() {
self.remote_changedir(parent, true); self.remote_changedir(parent, true);
// If sync is enabled update local too // If sync is enabled update local too
if self.browser.sync_browsing { if self.browser.sync_browsing && self.browser.found().is_none() {
self.synchronize_browsing(SyncBrowsingDestination::ParentDir); self.synchronize_browsing(SyncBrowsingDestination::ParentDir);
} }
} }

View File

@@ -112,7 +112,7 @@ impl FileTransferActivity {
if let SelectedEntry::One(entry) = self.get_local_selected_entries() { if let SelectedEntry::One(entry) = self.get_local_selected_entries() {
self.action_submit_local(entry); self.action_submit_local(entry);
// Update file list if sync // Update file list if sync
if self.browser.sync_browsing { if self.browser.sync_browsing && self.browser.found().is_none() {
let _ = self.update_remote_filelist(); let _ = self.update_remote_filelist();
} }
self.update_local_filelist(); self.update_local_filelist();
@@ -122,7 +122,7 @@ impl FileTransferActivity {
if let SelectedEntry::One(entry) = self.get_remote_selected_entries() { if let SelectedEntry::One(entry) = self.get_remote_selected_entries() {
self.action_submit_remote(entry); self.action_submit_remote(entry);
// Update file list if sync // Update file list if sync
if self.browser.sync_browsing { if self.browser.sync_browsing && self.browser.found().is_none() {
let _ = self.update_local_filelist(); let _ = self.update_local_filelist();
} }
self.update_remote_filelist(); self.update_remote_filelist();
@@ -161,7 +161,7 @@ impl FileTransferActivity {
// Umount // Umount
self.umount_goto(); self.umount_goto();
// Reload files if sync // Reload files if sync
if self.browser.sync_browsing { if self.browser.sync_browsing && self.browser.found().is_none() {
self.update_browser_file_list_swapped(); self.update_browser_file_list_swapped();
} }
// Reload files // Reload files
@@ -171,7 +171,7 @@ impl FileTransferActivity {
match self.browser.tab() { match self.browser.tab() {
FileExplorerTab::Local => { FileExplorerTab::Local => {
self.action_go_to_local_upper_dir(); self.action_go_to_local_upper_dir();
if self.browser.sync_browsing { if self.browser.sync_browsing && self.browser.found().is_none() {
let _ = self.update_remote_filelist(); let _ = self.update_remote_filelist();
} }
// Reload file list component // Reload file list component
@@ -179,7 +179,7 @@ impl FileTransferActivity {
} }
FileExplorerTab::Remote => { FileExplorerTab::Remote => {
self.action_go_to_remote_upper_dir(); self.action_go_to_remote_upper_dir();
if self.browser.sync_browsing { if self.browser.sync_browsing && self.browser.found().is_none() {
let _ = self.update_local_filelist(); let _ = self.update_local_filelist();
} }
// Reload file list component // Reload file list component
@@ -192,7 +192,7 @@ impl FileTransferActivity {
match self.browser.tab() { match self.browser.tab() {
FileExplorerTab::Local => { FileExplorerTab::Local => {
self.action_go_to_previous_local_dir(); self.action_go_to_previous_local_dir();
if self.browser.sync_browsing { if self.browser.sync_browsing && self.browser.found().is_none() {
let _ = self.update_remote_filelist(); let _ = self.update_remote_filelist();
} }
// Reload file list component // Reload file list component
@@ -200,7 +200,7 @@ impl FileTransferActivity {
} }
FileExplorerTab::Remote => { FileExplorerTab::Remote => {
self.action_go_to_previous_remote_dir(); self.action_go_to_previous_remote_dir();
if self.browser.sync_browsing { if self.browser.sync_browsing && self.browser.found().is_none() {
let _ = self.update_local_filelist(); let _ = self.update_local_filelist();
} }
// Reload file list component // Reload file list component