Skip to content

Commit 4d90e31

Browse files
authored
Remove warnings about non existent directories in Windows (#79)
1 parent bbc1bc6 commit 4d90e31

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

czkawka_core/src/common_directory.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl Directories {
8484
continue;
8585
}
8686
if !directory.exists() {
87-
text_messages.warnings.push(format!("Excluded Directory Warning: Provided folder path must exits, ignoring {}", directory.display()));
87+
// text_messages.warnings.push(format!("Excluded Directory Warning: Provided folder path must exits, ignoring {}", directory.display()));
8888
continue;
8989
}
9090
if !directory.is_dir() {

czkawka_gui/src/main.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -366,15 +366,14 @@ fn main() {
366366
let current_dir: String = match env::current_dir() {
367367
Ok(t) => t.to_str().unwrap().to_string(),
368368
Err(_) => {
369-
#[cfg(target_family = "unix")]
370-
{
369+
if cfg!(target_family = "unix") {
371370
println!("Failed to read current directory, setting /home instead");
372371
"/home".to_string()
373-
}
374-
#[cfg(target_family = "windows")]
375-
{
372+
} else if cfg!(target_family = "windows") {
376373
println!("Failed to read current directory, setting C:\\ instead");
377374
"C:\\".to_string()
375+
} else {
376+
"".to_string()
378377
}
379378
}
380379
};
@@ -408,13 +407,11 @@ fn main() {
408407
}
409408
// Set Excluded Items
410409
{
411-
#[cfg(target_family = "unix")]
412-
{
413-
entry_excluded_items.set_text("*/.git/,*/node_modules/,*/lost+found/");
410+
if cfg!(target_family = "unix") {
411+
entry_excluded_items.set_text("*/.git/*,*/node_modules/*,*/lost+found/*");
414412
}
415-
#[cfg(target_family = "windows")]
416-
{
417-
entry_excluded_items.set_text("*\\.git\\,*\\node_modules\\,*:\\Windows\\,:/Windows/");
413+
if cfg!(target_family = "windows") {
414+
entry_excluded_items.set_text("*/.git/*,*/node_modules/*,*/lost+found/*,*:/windows/*");
418415
}
419416
}
420417
}
@@ -912,7 +909,10 @@ fn main() {
912909
for path_to_delete in vec_path_to_delete {
913910
let mut vec_tree_path_to_delete: Vec<gtk::TreePath> = Vec::new();
914911

915-
let iter = list_store.get_iter_first().unwrap();
912+
let iter = match list_store.get_iter_first() {
913+
Some(t) => t,
914+
None => break,
915+
};
916916
let mut take_child_mode = false; // When original image is searched one, we must remove all occurences of its children
917917
let mut prepared_for_delete;
918918
loop {

0 commit comments

Comments
 (0)