From 85432f1c186aa828efc7f7df0436c61eb7c32843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= Date: Sat, 26 Sep 2020 17:16:12 +0200 Subject: [PATCH] Fix some typos in words and remove empty space --- README.md | 6 +++--- czkawka_core/src/big_file.rs | 6 +++--- czkawka_core/src/common_directory.rs | 26 +++++++++++++------------- czkawka_core/src/empty_folder.rs | 4 ++-- czkawka_gui/Cargo.toml | 2 +- czkawka_gui/src/main.rs | 2 +- czkawka_gui_orbtk/src/main.rs | 8 ++++---- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index a60f12a..3e436c8 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ This is my first ever project in Rust so probably a lot of things are written in - GTK Gui - Selection of records(don't know how to do this) - Popups - - Choosing directories(include, excluded) + - Choosing directories(included, excluded) - Popup with type of deleted records - Add Czkawka name to main window(now is czkawka_gui) - Run in another thread searching to be able to pause @@ -81,8 +81,8 @@ Next, this included and excluded folders are optimized due to tree structure of - Folders which contains another folders are combined(separately for included and excluded) - `/home/pulpet` and `/home/pulpet/a` are combined to `/home/pulpet` - Included folders which are located inside excluded ones are delete - Included folder `/etc/tomcat/` is deleted because excluded folder is `/etc/` - Non existed directories are being removed -- Excluded path which are outside include path are deleted - Exclude path `/etc/` is removed if included path is `/home/` -If after optimization there is no include folders, then program ends with non zero value(TODO, this should be handled by returning value). +- Excluded path which are outside included path are deleted - Excluded path `/etc/` is removed if included path is `/home/` +If after optimization there is no included folders, then program ends with non zero value(TODO, this should be handled by returning value). Next with provided by user minimal size of checked size `-s`, program checks recursively(TODO should be an option to turn off a recursion) included folders and checks files by sizes and put it files with same sizes to different boxes. Next boxes which contains only one element are removed because files inside are not duplicated. diff --git a/czkawka_core/src/big_file.rs b/czkawka_core/src/big_file.rs index fe9212b..9c1d43b 100644 --- a/czkawka_core/src/big_file.rs +++ b/czkawka_core/src/big_file.rs @@ -270,7 +270,7 @@ impl BigFile { self.directories.optimize_directories(self.recursive_search, &mut self.text_messages); } - /// Setting include directories, at least one must be provided + /// Setting included directories, at least one must be provided pub fn set_included_directory(&mut self, included_directory: String) { self.directories.set_included_directory(included_directory, &mut self.text_messages); } @@ -354,7 +354,7 @@ impl SaveResults for BigFile { for (size, files) in self.big_files.iter().rev() { for file_entry in files { - file.write_all(format!("{} ({}) - {}\n", size.file_size(options::BINARY).unwrap(), size, file_entry.path.clone()).as_bytes()).unwrap(); + file.write_all(format!("{} ({}) - {}\n", size.file_size(options::BINARY).unwrap(), size, file_entry.path.clone()).as_bytes()).unwrap(); } } } else { @@ -371,7 +371,7 @@ impl PrintResults for BigFile { for (size, vector) in self.big_files.iter().rev() { // TODO Align all to same width for entry in vector { - println!("{} ({}) - {}", size.file_size(options::BINARY).unwrap(), size, entry.path); + println!("{} ({}) - {}", size.file_size(options::BINARY).unwrap(), size, entry.path); } } Common::print_time(start_time, SystemTime::now(), "print_duplicated_entries".to_string()); diff --git a/czkawka_core/src/common_directory.rs b/czkawka_core/src/common_directory.rs index a0d5460..8f6b9ca 100644 --- a/czkawka_core/src/common_directory.rs +++ b/czkawka_core/src/common_directory.rs @@ -15,7 +15,7 @@ impl Directories { } } - /// Setting include directories, at least one must be provided + /// Setting included directories, at least one must be provided pub fn set_included_directory(&mut self, mut included_directory: String, text_messages: &mut Messages) -> bool { let start_time: SystemTime = SystemTime::now(); @@ -35,19 +35,19 @@ impl Directories { continue; } if directory.contains('*') { - text_messages.warnings.push("Include Directory Warning: Wildcards in path are not supported, ignoring ".to_string() + directory.as_str()); + text_messages.warnings.push("Included Directory Warning: Wildcards in path are not supported, ignoring ".to_string() + directory.as_str()); continue; } if !directory.starts_with('/') { - text_messages.warnings.push("Include Directory Warning: Relative path are not supported, ignoring ".to_string() + directory.as_str()); + text_messages.warnings.push("Included Directory Warning: Relative path are not supported, ignoring ".to_string() + directory.as_str()); continue; } if !Path::new(&directory).exists() { - text_messages.warnings.push("Include Directory Warning: Provided folder path must exits, ignoring ".to_string() + directory.as_str()); + text_messages.warnings.push("Included Directory Warning: Provided folder path must exits, ignoring ".to_string() + directory.as_str()); continue; } if !Path::new(&directory).is_dir() { - text_messages.warnings.push("Include Directory Warning: Provided path must point at the directory, ignoring ".to_string() + directory.as_str()); + text_messages.warnings.push("Included Directory Warning: Provided path must point at the directory, ignoring ".to_string() + directory.as_str()); continue; } @@ -60,7 +60,7 @@ impl Directories { } if checked_directories.is_empty() { - text_messages.errors.push("Include Directory ERROR: Not found even one correct path to include which is required.".to_string()); + text_messages.errors.push("Included Directory ERROR: Not found even one correct path to included which is required.".to_string()); return false; } @@ -88,23 +88,23 @@ impl Directories { continue; } if directory == "/" { - text_messages.errors.push("Exclude Directory ERROR: Excluding / is pointless, because it means that no files will be scanned.".to_string()); + text_messages.errors.push("Excluded Directory ERROR: Excluding / is pointless, because it means that no files will be scanned.".to_string()); break; } if directory.contains('*') { - text_messages.warnings.push("Exclude Directory Warning: Wildcards in path are not supported, ignoring ".to_string() + directory.as_str()); + text_messages.warnings.push("Excluded Directory Warning: Wildcards in path are not supported, ignoring ".to_string() + directory.as_str()); continue; } if !directory.starts_with('/') { - text_messages.warnings.push("Exclude Directory Warning: Relative path are not supported, ignoring ".to_string() + directory.as_str()); + text_messages.warnings.push("Excluded Directory Warning: Relative path are not supported, ignoring ".to_string() + directory.as_str()); continue; } if !Path::new(&directory).exists() { - text_messages.warnings.push("Exclude Directory Warning: Provided folder path must exits, ignoring ".to_string() + directory.as_str()); + text_messages.warnings.push("Excluded Directory Warning: Provided folder path must exits, ignoring ".to_string() + directory.as_str()); continue; } if !Path::new(&directory).is_dir() { - text_messages.warnings.push("Exclude Directory Warning: Provided path must point at the directory, ignoring ".to_string() + directory.as_str()); + text_messages.warnings.push("Excluded Directory Warning: Provided path must point at the directory, ignoring ".to_string() + directory.as_str()); continue; } @@ -179,7 +179,7 @@ impl Directories { optimized_excluded = Vec::::new(); } - // Remove include directories which are inside any exclude directory + // Remove included directories which are inside any excluded directory for id in &self.included_directories { let mut is_inside: bool = false; for ed in &self.excluded_directories { @@ -215,7 +215,7 @@ impl Directories { self.excluded_directories = optimized_excluded; optimized_excluded = Vec::::new(); - // Excluded paths must are inside include path, because + // Excluded paths must are inside included path, because for ed in &self.excluded_directories { let mut is_inside: bool = false; for id in &self.included_directories { diff --git a/czkawka_core/src/empty_folder.rs b/czkawka_core/src/empty_folder.rs index 6c3b906..dc8599d 100644 --- a/czkawka_core/src/empty_folder.rs +++ b/czkawka_core/src/empty_folder.rs @@ -24,7 +24,7 @@ pub struct FolderEntry { pub modified_date: SystemTime, } -/// Struct to store most basics info about all folder +/// Struct to store most basics info about all folder pub struct EmptyFolder { information: Info, delete_folders: bool, @@ -250,7 +250,7 @@ impl EmptyFolder { Common::print_time(start_time, SystemTime::now(), "delete_files".to_string()); } - /// Set include dir which needs to be relative, exists etc. + /// Set included dir which needs to be relative, exists etc. pub fn set_included_directory(&mut self, included_directory: String) { self.directories.set_included_directory(included_directory, &mut self.text_messages); } diff --git a/czkawka_gui/Cargo.toml b/czkawka_gui/Cargo.toml index dc9118d..84faf97 100644 --- a/czkawka_gui/Cargo.toml +++ b/czkawka_gui/Cargo.toml @@ -18,6 +18,6 @@ chrono = "0.4" [dependencies.gtk] version = "0.9.2" -default-features = false # just in case +default-features = false # just in case features = ["v3_18"] diff --git a/czkawka_gui/src/main.rs b/czkawka_gui/src/main.rs index 4110cf8..929af76 100644 --- a/czkawka_gui/src/main.rs +++ b/czkawka_gui/src/main.rs @@ -136,7 +136,7 @@ fn main() { buttons_save.hide(); buttons_delete.hide(); - // Set Include Directory + // Set Included Directory { let col_types: [glib::types::Type; 2] = [glib::types::Type::String, glib::types::Type::String]; let list_store: gtk::ListStore = gtk::ListStore::new(&col_types); diff --git a/czkawka_gui_orbtk/src/main.rs b/czkawka_gui_orbtk/src/main.rs index db18c3b..ce1e1d5 100644 --- a/czkawka_gui_orbtk/src/main.rs +++ b/czkawka_gui_orbtk/src/main.rs @@ -16,11 +16,11 @@ fn main() { .columns(Columns::create().push(105.0).push(67.0)) .rows(Rows::create().push(50.0).push(32.0).push(32.0).push(32.0).push(32.0)) .margin((84, 40)) - .child(TextBlock::new().text("Include Directory:").v_align("center").h_align("start").attach(Grid::column(0)).attach(Grid::row(0)).build(ctx)) + .child(TextBlock::new().text("Included Directory:").v_align("center").h_align("start").attach(Grid::column(0)).attach(Grid::row(0)).build(ctx)) .child( TextBox::new() .id("included_directory") - .water_mark("Include Directory") + .water_mark("Included Directory") .v_align("center") .h_align("start") .attach(Grid::column(1)) @@ -28,11 +28,11 @@ fn main() { .min_width(300.0) .build(ctx), ) - .child(TextBlock::new().text("Exclude Directory:").v_align("center").h_align("start").attach(Grid::column(0)).attach(Grid::row(1)).build(ctx)) + .child(TextBlock::new().text("Excluded Directory:").v_align("center").h_align("start").attach(Grid::column(0)).attach(Grid::row(1)).build(ctx)) .child( TextBox::new() .id("excluded_directory") - .water_mark("Exclude Directory") + .water_mark("Excluded Directory") .v_align("center") .h_align("start") .attach(Grid::column(1))