Skip to content
Merged

CI Test #1600

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
if: ${{ github.ref == 'refs/heads/master' }}
run: |
sed -i 's/#lto = /lto = /g' Cargo.toml
sed -i 's/#codegen-units /codegen-units = 1/g' Cargo.toml
sed -i 's/#codegen-units /codegen-units /g' Cargo.toml

echo "VERS=release" >> $GITHUB_ENV

Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
if: ${{ github.ref == 'refs/heads/master' }}
run: |
sed -i 's/#lto = /lto = /g' Cargo.toml
sed -i 's/#codegen-units /codegen-units = 1/g' Cargo.toml
sed -i 's/#codegen-units /codegen-units /g' Cargo.toml
cargo build --release --bin czkawka_cli --target x86_64-unknown-linux-musl

mv target/x86_64-unknown-linux-musl/release/czkawka_cli linux_czkawka_cli_musl
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
run: |
set -e
sed -i '' 's/#lto = "thin"/lto = "thin"/g' Cargo.toml
sed -i '' 's/#codegen-units = 1/codegen-units = 1/g' Cargo.toml
sed -i '' 's/#codegen-units /codegen-units /g' Cargo.toml
Copy link

Copilot AI Aug 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sed pattern is incomplete and will result in invalid TOML syntax. It removes the comment character but doesn't set a value for codegen-units. Consider using 's/#codegen-units = 1/codegen-units = 1/g'.

Suggested change
sed -i '' 's/#codegen-units /codegen-units /g' Cargo.toml
sed -i '' 's/#codegen-units = 1/codegen-units = 1/g' Cargo.toml

Copilot uses AI. Check for mistakes.


echo "VERS=release" >> $GITHUB_ENV

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
if: ${{ github.ref == 'refs/heads/master' }}
run: |
sed -i 's/#lto = /lto = /g' Cargo.toml
sed -i 's/#codegen-units /codegen-units = 1/g' Cargo.toml
sed -i 's/#codegen-units /codegen-units /g' Cargo.toml
cargo build --release --target x86_64-pc-windows-gnu --bin krokiet
mv target/x86_64-pc-windows-gnu/release/krokiet.exe windows_krokiet_on_linux.exe

Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
# if: ${{ github.ref == 'refs/heads/master' }}
# run: |
# sed -i 's/#lto = /lto = /g' Cargo.toml
# sed -i 's/#codegen-units /codegen-units = 1/g' Cargo.toml
# sed -i 's/#codegen-units /codegen-units /g' Cargo.toml
# cargo build --release --bin krokiet --no-default-features --features "winit_skia_opengl,winit_software"
# mv target/release/krokiet.exe windows_krokiet_on_windows_skia_opengl.exe
# cargo build --release --bin krokiet --no-default-features --features "winit_skia_vulkan,winit_software"
Expand Down
17 changes: 17 additions & 0 deletions czkawka_gui/src/connect_things/connect_button_delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::fs;
use czkawka_core::common::check_if_folder_contains_only_empty_folders;
use gtk4::prelude::*;
use gtk4::{Align, CheckButton, Dialog, Orientation, ResponseType, TextView};
use log::debug;

use crate::flg;
use crate::gui_structs::gui_data::GuiData;
Expand Down Expand Up @@ -290,6 +291,10 @@ pub(crate) fn empty_folder_remover(
return; // No selected rows
}

debug!("Starting to delete {} folders", selected_rows.len());
let start_time = std::time::Instant::now();
let mut deleted_folders: u32 = 0;

let mut messages: String = String::new();

// Must be deleted from end to start, because when deleting entries, TreePath(and also TreeIter) will points to invalid data
Expand All @@ -308,13 +313,15 @@ pub(crate) fn empty_folder_remover(
match fs::remove_dir_all(&full_path) {
Ok(()) => {
model.remove(&iter);
deleted_folders += 1;
}
Err(_inspected) => error_happened = true,
}
} else {
match trash::delete(&full_path) {
Ok(()) => {
model.remove(&iter);
deleted_folders += 1;
}
Err(_inspected) => error_happened = true,
}
Expand All @@ -328,6 +335,8 @@ pub(crate) fn empty_folder_remover(
}
}

debug!("Deleted {deleted_folders} folders in {:?}", start_time.elapsed());

text_view_errors.buffer().set_text(messages.as_str());
}

Expand Down Expand Up @@ -363,6 +372,10 @@ pub(crate) fn basic_remove(
return; // No selected rows
}

debug!("Starting to delete {} files", selected_rows.len());
let start_time = std::time::Instant::now();
let mut deleted_files: u32 = 0;

// Must be deleted from end to start, because when deleting entries, TreePath(and also TreeIter) will points to invalid data
for tree_path in selected_rows.iter().rev() {
let iter = model.iter(tree_path).expect("Using invalid tree_path");
Expand All @@ -374,6 +387,7 @@ pub(crate) fn basic_remove(
match fs::remove_file(get_full_name_from_path_name(&path, &name)) {
Ok(()) => {
model.remove(&iter);
deleted_files += 1;
}

Err(e) => {
Expand All @@ -385,6 +399,7 @@ pub(crate) fn basic_remove(
match trash::delete(get_full_name_from_path_name(&path, &name)) {
Ok(()) => {
model.remove(&iter);
deleted_files += 1;
}
Err(e) => {
messages += flg!("delete_file_failed", name = get_full_name_from_path_name(&path, &name), reason = e.to_string()).as_str();
Expand All @@ -394,6 +409,8 @@ pub(crate) fn basic_remove(
}
}

debug!("Deleted {deleted_files} files in {:?}", start_time.elapsed());

text_view_errors.buffer().set_text(messages.as_str());
}

Expand Down
6 changes: 6 additions & 0 deletions czkawka_gui/src/connect_things/connect_button_move.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::path::{Path, PathBuf};
use fs_extra::dir::CopyOptions;
use gtk4::prelude::*;
use gtk4::{ResponseType, TreePath};
use log::debug;

use crate::flg;
use crate::gui_structs::gui_data::GuiData;
Expand Down Expand Up @@ -182,6 +183,9 @@ fn move_files_common(

let mut moved_files: u32 = 0;

debug!("Starting to move {} files", selected_rows.len());
let start_time = std::time::Instant::now();

// Save to variable paths of files, and remove it when not removing all occurrences.
'next_result: for tree_path in selected_rows.iter().rev() {
let iter = model.iter(tree_path).expect("Using invalid tree_path");
Expand Down Expand Up @@ -209,6 +213,8 @@ fn move_files_common(
moved_files += 1;
}

debug!("Moved {moved_files} files in {:?}", start_time.elapsed());

entry_info.set_text(flg!("move_stats", num_files = moved_files, all_files = selected_rows.len()).as_str());

text_view_errors.buffer().set_text(messages.as_str());
Expand Down
20 changes: 19 additions & 1 deletion krokiet/src/model_operations/model_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crossbeam_channel::Sender;
use czkawka_core::common::progress_data::{CurrentStage, ProgressData};
use czkawka_core::helpers::delayed_sender::DelayedSender;
use czkawka_core::helpers::messages::Messages;
use log::error;
use log::{debug, error};
use rayon::iter::{IntoParallelIterator, ParallelIterator};
use slint::{ComponentHandle, ModelRc, VecModel, Weak};

Expand Down Expand Up @@ -54,6 +54,13 @@ impl MessageType {
Self::Move => ProgressData::get_empty_state(CurrentStage::MovingFiles),
}
}
fn msg_type(&self) -> &'static str {
match self {
Self::Delete => "delete",
Self::Rename => "rename",
Self::Move => "move",
}
}
}

impl ModelProcessor {
Expand Down Expand Up @@ -148,6 +155,7 @@ impl ModelProcessor {
.expect("Failed to update app info text");

let items_queued_to_delete = simpler_model.iter().filter(|(_idx, e)| e.checked).count();
debug!("Processing {} items for {}", items_queued_to_delete, message_type.msg_type());
if items_queued_to_delete == 0 {
weak_app
.upgrade_in_event_loop(move |app| {
Expand All @@ -170,8 +178,18 @@ impl ModelProcessor {
.unwrap_or_default();
let _ = progress_sender.send(base_progress).map_err(|e| error!("Failed to send progress data: {e}"));

let start_time = std::time::Instant::now();
let results = self.process_items(simpler_model, items_queued_to_delete, progress_sender.clone(), &stop_flag, dlt_fnc, message_type, size_idx);
let processing_time = start_time.elapsed();
let removing_items_from_model = std::time::Instant::now();
let (new_simple_model, errors, items_deleted) = self.remove_deleted_items_from_model(results);
debug!(
"Items processed in {processing_time:?}, removing items from model took {:?}, from all {} items, removed from list {}, failed to process {}",
removing_items_from_model.elapsed(),
items_queued_to_delete,
items_deleted,
errors.len()
);
let errors_len = errors.len();

// Sending progress data at the end of deletion, to indicate that deletion is finished
Expand Down
Loading