Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
qarmin committed Nov 17, 2023
1 parent c27236e commit 87d8f90
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions czkawka_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ anyhow = { version = "1.0" }

state = "0.6"

rustc_version = "0.4"
log = "0.4.20"
handsome_logger = "0.8"
fun_time = { version = "0.3.1", features = ["log"] }
Expand Down
14 changes: 11 additions & 3 deletions czkawka_core/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use image::{DynamicImage, ImageBuffer, Rgb};
use imagepipe::{ImageSource, Pipeline};
#[cfg(feature = "heif")]
use libheif_rs::{ColorSpace, HeifContext, RgbChroma};
use log::{debug, info, LevelFilter, Record};
use log::{debug, info, warn, LevelFilter, Record};

// #[cfg(feature = "heif")]
// use libheif_rs::LibHeif;
Expand Down Expand Up @@ -58,11 +58,19 @@ pub fn setup_logger(disabled_printing: bool) {
}

pub fn print_version_mode() {
let rust_version = match rustc_version::version_meta() {
Ok(meta) => meta.semver.to_string(),
Err(_) => "<unknown>".to_string(),
};

info!(
"Czkawka version: {}, was compiled with {} mode",
"App version: {}, compiled with {} mode on rustc {rust_version}",
CZKAWKA_VERSION,
if cfg!(debug_assertions) { "debug" } else { "release" }
if cfg!(debug_assertions) { "debug" } else { "release" },
);
if cfg!(debug_assertions) {
warn!("You are running debug version of app which is a lot of slower than release version.");
}
}

pub fn set_default_number_of_threads() {
Expand Down
3 changes: 2 additions & 1 deletion krokiet/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ use crate::connect_progress_receiver::connect_progress_gathering;
use crate::connect_show_preview::connect_show_preview;
use crate::connect_stop::connect_stop_button;
use crate::settings::{load_settings_from_file, reset_settings, save_settings_to_file};
use czkawka_core::common::setup_logger;
use czkawka_core::common::{print_version_mode, setup_logger};
use czkawka_core::common_dir_traversal::ProgressData;
use slint::{ModelRc, VecModel};

slint::include_modules!();
fn main() {
setup_logger(false);
print_version_mode();

let app = MainWindow::new().unwrap();

Expand Down
6 changes: 6 additions & 0 deletions krokiet/ui/main_lists.slint
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ export component MainList {
parentPathIdx: 5;
fileNameIdx: 4;
}
focus_item := FocusScope {
key-released(event) => {
debug(event);
accept
}
}
changed_current_tab() => {
empty_folders.deselect_selected_item();
empty_files.deselect_selected_item();
Expand Down

0 comments on commit 87d8f90

Please sign in to comment.