2
0
mirror of https://github.com/qarmin/czkawka synced 2024-11-13 19:11:06 +00:00

more fixes

This commit is contained in:
xXxSuShIkiTtY420xXx 2021-10-17 12:03:24 -07:00 committed by GitHub
parent e5f80db0a7
commit b7b270df21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -367,7 +367,7 @@ pub fn empty_folder_remover(tree_view: &gtk::TreeView, column_file_name: i32, co
let full_path = format!("{}/{}", path, name);
#[cfg(target_family = "windows")]
let full_path = full_path.replace("/", "\\");
let full_path = format!("{}/{}", path, name).replace("/", "\\");
if !error_happened {
if !use_trash {
@ -385,7 +385,8 @@ pub fn empty_folder_remover(tree_view: &gtk::TreeView, column_file_name: i32, co
Err(_) => error_happened = true,
}
}
} else {
}
if error_happened {
messages += format!("Failed to remove folder {} because folder doesn't exists, you don't have permissions or isn't empty.\n", full_path).as_str()
}
}
@ -425,7 +426,7 @@ pub fn basic_remove(tree_view: &gtk::TreeView, column_file_name: i32, column_pat
let full_path = format!("{}/{}", path, name);
#[cfg(target_family = "windows")]
let full_path = full_path.replace("/", "\\");
let full_path = format!("{}/{}", path, name).replace("/", "\\");
if !use_trash {
match fs::remove_file(full_path) {
@ -497,7 +498,7 @@ pub fn tree_remove(tree_view: &gtk::TreeView, column_file_name: i32, column_path
let full_path = format!("{}/{}", path.clone(), file_name.clone());
#[cfg(target_family = "windows")]
let full_path = full_path.replace("/", "\\");
let full_path = format!("{}/{}", path.clone(), file_name.clone()).replace("/", "\\");
if !use_trash {
if fs::remove_file(full_path).is_err() {