1
0
Fork 0
mirror of synced 2024-06-01 18:19:46 +12:00

Remove warnings about non existent directories in Windows

This commit is contained in:
Rafał Mikrut 2020-10-21 21:51:16 +02:00
parent 460a3c22b3
commit c39018fcfe
2 changed files with 11 additions and 12 deletions

View file

@ -84,7 +84,7 @@ impl Directories {
continue;
}
if !directory.exists() {
text_messages.warnings.push(format!("Excluded Directory Warning: Provided folder path must exits, ignoring {}", directory.display()));
// text_messages.warnings.push(format!("Excluded Directory Warning: Provided folder path must exits, ignoring {}", directory.display()));
continue;
}
if !directory.is_dir() {

View file

@ -366,13 +366,11 @@ fn main() {
let current_dir: String = match env::current_dir() {
Ok(t) => t.to_str().unwrap().to_string(),
Err(_) => {
#[cfg(target_family = "unix")]
{
if cfg!(target_family = "unix") {
println!("Failed to read current directory, setting /home instead");
"/home".to_string()
}
#[cfg(target_family = "windows")]
{
if cfg!(target_family = "windows") {
println!("Failed to read current directory, setting C:\\ instead");
"C:\\".to_string()
}
@ -408,13 +406,11 @@ fn main() {
}
// Set Excluded Items
{
#[cfg(target_family = "unix")]
{
entry_excluded_items.set_text("*/.git/,*/node_modules/,*/lost+found/");
if cfg!(target_family = "unix") {
entry_excluded_items.set_text("*/.git/*,*/node_modules/*,*/lost+found/*");
}
#[cfg(target_family = "windows")]
{
entry_excluded_items.set_text("*\\.git\\,*\\node_modules\\,*:\\Windows\\,:/Windows/");
if cfg!(target_family = "windows") {
entry_excluded_items.set_text("*/.git/*,*/node_modules/*,*/lost+found/*,*:/windows/*");
}
}
}
@ -912,7 +908,10 @@ fn main() {
for path_to_delete in vec_path_to_delete {
let mut vec_tree_path_to_delete: Vec<gtk::TreePath> = Vec::new();
let iter = list_store.get_iter_first().unwrap();
let iter = match list_store.get_iter_first() {
Some(t) => t,
None => break,
};
let mut take_child_mode = false; // When original image is searched one, we must remove all occurences of its children
let mut prepared_for_delete;
loop {