From 4228f55bdc0a76e69e45905775e0eaabb733b435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= Date: Tue, 19 Dec 2023 17:04:19 +0100 Subject: [PATCH] Common --- czkawka_core/src/common.rs | 2 +- czkawka_core/src/common_directory.rs | 3 +-- krokiet/ui/left_side_panel.slint | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/czkawka_core/src/common.rs b/czkawka_core/src/common.rs index 04eed44..cc46b79 100644 --- a/czkawka_core/src/common.rs +++ b/czkawka_core/src/common.rs @@ -500,7 +500,7 @@ where if dry_run { infos.push(format!("dry_run - would delete file: {:?}", i.get_path())); } else { - if let Err(e) = std::fs::remove_file(i.get_path()) { + if let Err(e) = fs::remove_file(i.get_path()) { errors.push(format!("Cannot delete file: {:?} - {e}", i.get_path())); failed_to_remove_files += 1; } else { diff --git a/czkawka_core/src/common_directory.rs b/czkawka_core/src/common_directory.rs index f1a78b4..732bd07 100644 --- a/czkawka_core/src/common_directory.rs +++ b/czkawka_core/src/common_directory.rs @@ -305,8 +305,7 @@ impl Directories { self.reference_directories.iter().any(|e| path.starts_with(e)) } - pub fn is_excluded(&self, path: impl AsRef) -> bool { - let path = path.as_ref(); + pub fn is_excluded(&self, path: &Path) -> bool { #[cfg(target_family = "windows")] let path = normalize_windows_path(path); // We're assuming that `excluded_directories` are already normalized diff --git a/krokiet/ui/left_side_panel.slint b/krokiet/ui/left_side_panel.slint index 7521ef7..9e92d2b 100644 --- a/krokiet/ui/left_side_panel.slint +++ b/krokiet/ui/left_side_panel.slint @@ -108,7 +108,7 @@ export component LeftSidePanel { HorizontalLayout { alignment: start; Button { - enabled: GuiState.active_tab != CurrentTab.Settings && GuiState.available_subsettings; + visible: GuiState.active_tab != CurrentTab.Settings && GuiState.available_subsettings; min-width: 20px; min-height: 20px; max-height: self.width; @@ -122,7 +122,7 @@ export component LeftSidePanel { HorizontalLayout { alignment: end; Button { - enabled: GuiState.active_tab != CurrentTab.Settings; + visible: GuiState.active_tab != CurrentTab.Settings; min-width: 20px; min-height: 20px; max-height: self.width;