2
0
mirror of https://github.com/qarmin/czkawka synced 2024-11-10 07:10:40 +00:00

Allowed extensions

This commit is contained in:
Rafał Mikrut 2024-01-17 23:35:02 +01:00
parent e628fcb395
commit 419146331f
18 changed files with 300 additions and 262 deletions

389
Cargo.lock generated
View File

@ -18,6 +18,15 @@ version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046"
[[package]]
name = "addr2line"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb"
dependencies = [
"gimli",
]
[[package]]
name = "adler"
version = "1.0.2"
@ -76,7 +85,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39b801912a977c3fd52d80511fe1c0c8480c6f957f21ae2ce1b92ffe970cf4b9"
dependencies = [
"android-properties",
"bitflags 2.4.1",
"bitflags 2.4.2",
"cc",
"cesu8",
"jni",
@ -113,9 +122,9 @@ dependencies = [
[[package]]
name = "anstream"
version = "0.6.7"
version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4cd2405b3ac1faab2990b74d728624cd9fd115651fcecc7c2d8daf01376275ba"
checksum = "628a8f9bd1e24b4e0db2b4bc2d000b001e7dd032d54afa60a68836aeec5aa54a"
dependencies = [
"anstyle",
"anstyle-parse",
@ -204,8 +213,6 @@ version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ac22eda5891cc086690cb6fa10121c0390de0e3b04eb269f2d766b00d3f2d81"
dependencies = [
"async-fs 2.1.0",
"async-net",
"enumflags2",
"futures-channel",
"futures-util",
@ -213,6 +220,7 @@ dependencies = [
"rand",
"serde",
"serde_repr",
"tokio",
"url",
"zbus",
]
@ -240,43 +248,6 @@ dependencies = [
"pin-project-lite",
]
[[package]]
name = "async-executor"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c"
dependencies = [
"async-lock 3.3.0",
"async-task",
"concurrent-queue",
"fastrand 2.0.1",
"futures-lite 2.2.0",
"slab",
]
[[package]]
name = "async-fs"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06"
dependencies = [
"async-lock 2.8.0",
"autocfg",
"blocking",
"futures-lite 1.13.0",
]
[[package]]
name = "async-fs"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd1f344136bad34df1f83a47f3fd7f2ab85d75cb8a940af4ccf6d482a84ea01b"
dependencies = [
"async-lock 3.3.0",
"blocking",
"futures-lite 2.2.0",
]
[[package]]
name = "async-io"
version = "1.13.0"
@ -293,15 +264,15 @@ dependencies = [
"polling 2.8.0",
"rustix 0.37.27",
"slab",
"socket2",
"socket2 0.4.10",
"waker-fn",
]
[[package]]
name = "async-io"
version = "2.2.2"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6afaa937395a620e33dc6a742c593c01aced20aa376ffb0f628121198578ccc7"
checksum = "fb41eb19024a91746eba0773aa5e16036045bbf45733766661099e182ea6a744"
dependencies = [
"async-lock 3.3.0",
"cfg-if",
@ -309,7 +280,7 @@ dependencies = [
"futures-io",
"futures-lite 2.2.0",
"parking",
"polling 3.3.1",
"polling 3.3.2",
"rustix 0.38.30",
"slab",
"tracing",
@ -336,17 +307,6 @@ dependencies = [
"pin-project-lite",
]
[[package]]
name = "async-net"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7"
dependencies = [
"async-io 2.2.2",
"blocking",
"futures-lite 2.2.0",
]
[[package]]
name = "async-process"
version = "1.8.1"
@ -381,7 +341,7 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5"
dependencies = [
"async-io 2.2.2",
"async-io 2.3.0",
"async-lock 2.8.0",
"atomic-waker",
"cfg-if",
@ -427,9 +387,9 @@ dependencies = [
[[package]]
name = "auto_enums"
version = "0.8.3"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a764179c02b324e33cf71b4180e7dd13572400ff7e5c866da813f6c84e0e4cd3"
checksum = "f1c074a5fdb14f54a9cc22ad68979588325bc6986eed6b859e03de43e4880214"
dependencies = [
"derive_utils",
"proc-macro2",
@ -443,6 +403,21 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "backtrace"
version = "0.3.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837"
dependencies = [
"addr2line",
"cc",
"cfg-if",
"libc",
"miniz_oxide",
"object",
"rustc-demangle",
]
[[package]]
name = "base64"
version = "0.21.7"
@ -470,7 +445,7 @@ version = "0.69.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4c69fae65a523209d34240b60abe0c42d33d1045d445c0839d8a4894a736e2d"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"cexpr",
"clang-sys",
"lazy_static",
@ -501,9 +476,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.4.1"
version = "2.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"
[[package]]
name = "bk-tree"
@ -658,7 +633,7 @@ version = "0.18.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"cairo-sys-rs",
"glib",
"libc",
@ -679,13 +654,13 @@ dependencies = [
[[package]]
name = "calloop"
version = "0.12.3"
version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b50b5a44d59a98c55a9eeb518f39bf7499ba19fd98ee7d22618687f3f10adbf"
checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"log",
"polling 3.3.1",
"polling 3.3.2",
"rustix 0.38.30",
"slab",
"thiserror",
@ -822,9 +797,9 @@ dependencies = [
[[package]]
name = "clap"
version = "4.4.16"
version = "4.4.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58e54881c004cec7895b0068a0a954cd5d62da01aef83fa35b1e594497bf5445"
checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c"
dependencies = [
"clap_builder",
"clap_derive",
@ -832,9 +807,9 @@ dependencies = [
[[package]]
name = "clap_builder"
version = "4.4.16"
version = "4.4.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59cb82d7f531603d2fd1f507441cdd35184fa81beff7bd489570de7f773460bb"
checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7"
dependencies = [
"anstream",
"anstyle",
@ -969,7 +944,7 @@ dependencies = [
[[package]]
name = "const-field-offset"
version = "0.1.3"
source = "git+https://github.com/slint-ui/slint.git#ff2bf6849e2d6325db1650ebe3dc96137573d272"
source = "git+https://github.com/slint-ui/slint.git#7a295d1b75121fa1b21996588511c98772488fe4"
dependencies = [
"const-field-offset-macro",
"field-offset",
@ -978,7 +953,7 @@ dependencies = [
[[package]]
name = "const-field-offset-macro"
version = "0.1.3"
source = "git+https://github.com/slint-ui/slint.git#ff2bf6849e2d6325db1650ebe3dc96137573d272"
source = "git+https://github.com/slint-ui/slint.git#7a295d1b75121fa1b21996588511c98772488fe4"
dependencies = [
"proc-macro2",
"quote",
@ -1230,7 +1205,7 @@ dependencies = [
"anyhow",
"audio_checker",
"bincode",
"bitflags 2.4.1",
"bitflags 2.4.2",
"bk-tree",
"blake3",
"crc32fast",
@ -1528,7 +1503,7 @@ version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0f8a69e60d75ae7dab4ef26a59ca99f2a89d4c142089b537775ae0c198bdcde"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"bytemuck",
"drm-ffi 0.7.1",
"drm-fourcc",
@ -1577,7 +1552,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d09ff881f92f118b11105ba5e34ff8f4adf27b30dae8f12e28c193af1c83176"
dependencies = [
"libc",
"linux-raw-sys 0.6.3",
"linux-raw-sys 0.6.4",
]
[[package]]
@ -1763,9 +1738,9 @@ dependencies = [
[[package]]
name = "fdeflate"
version = "0.3.3"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "209098dd6dfc4445aa6111f0e98653ac323eaa4dfd212c9ca3931bf9955c31bd"
checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645"
dependencies = [
"simd-adler32",
]
@ -1776,7 +1751,7 @@ version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19df4b4c86231086212f22513ccfdbce94a1e1270d1cb09c030bd39fd73f3ee4"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"fnv",
"generational-arena",
"glow",
@ -2078,10 +2053,7 @@ version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba"
dependencies = [
"fastrand 2.0.1",
"futures-core",
"futures-io",
"parking",
"pin-project-lite",
]
@ -2115,11 +2087,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
dependencies = [
"futures-core",
"futures-io",
"futures-macro",
"futures-sink",
"futures-task",
"memchr",
"pin-project-lite",
"pin-utils",
"slab",
@ -2280,6 +2250,12 @@ dependencies = [
"weezl",
]
[[package]]
name = "gimli"
version = "0.28.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
[[package]]
name = "gio"
version = "0.18.4"
@ -2329,7 +2305,7 @@ version = "0.18.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"futures-channel",
"futures-core",
"futures-executor",
@ -2388,9 +2364,9 @@ dependencies = [
[[package]]
name = "glow"
version = "0.13.0"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "886c2a30b160c4c6fec8f987430c26b526b7988ca71f664e6a699ddf6f9601e4"
checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1"
dependencies = [
"js-sys",
"slotmap",
@ -2404,7 +2380,7 @@ version = "0.31.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "005459a22af86adc706522d78d360101118e2638ec21df3852fcc626e0dbb212"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"cfg_aliases 0.1.1",
"cgl",
"core-foundation",
@ -2644,9 +2620,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
[[package]]
name = "hermit-abi"
version = "0.3.3"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7"
checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f"
[[package]]
name = "hex"
@ -2684,7 +2660,7 @@ dependencies = [
[[package]]
name = "i-slint-backend-linuxkms"
version = "1.4.0"
source = "git+https://github.com/slint-ui/slint.git#ff2bf6849e2d6325db1650ebe3dc96137573d272"
source = "git+https://github.com/slint-ui/slint.git#7a295d1b75121fa1b21996588511c98772488fe4"
dependencies = [
"calloop",
"drm 0.9.0",
@ -2704,7 +2680,7 @@ dependencies = [
[[package]]
name = "i-slint-backend-selector"
version = "1.4.0"
source = "git+https://github.com/slint-ui/slint.git#ff2bf6849e2d6325db1650ebe3dc96137573d272"
source = "git+https://github.com/slint-ui/slint.git#7a295d1b75121fa1b21996588511c98772488fe4"
dependencies = [
"cfg-if",
"i-slint-backend-linuxkms",
@ -2717,7 +2693,7 @@ dependencies = [
[[package]]
name = "i-slint-backend-winit"
version = "1.4.0"
source = "git+https://github.com/slint-ui/slint.git#ff2bf6849e2d6325db1650ebe3dc96137573d272"
source = "git+https://github.com/slint-ui/slint.git#7a295d1b75121fa1b21996588511c98772488fe4"
dependencies = [
"bytemuck",
"cfg-if",
@ -2741,7 +2717,6 @@ dependencies = [
"rgb",
"scoped-tls-hkt",
"scopeguard",
"send_wrapper",
"softbuffer",
"vtable",
"wasm-bindgen",
@ -2752,7 +2727,7 @@ dependencies = [
[[package]]
name = "i-slint-common"
version = "1.4.0"
source = "git+https://github.com/slint-ui/slint.git#ff2bf6849e2d6325db1650ebe3dc96137573d272"
source = "git+https://github.com/slint-ui/slint.git#7a295d1b75121fa1b21996588511c98772488fe4"
dependencies = [
"cfg-if",
"derive_more",
@ -2763,7 +2738,7 @@ dependencies = [
[[package]]
name = "i-slint-compiler"
version = "1.4.0"
source = "git+https://github.com/slint-ui/slint.git#ff2bf6849e2d6325db1650ebe3dc96137573d272"
source = "git+https://github.com/slint-ui/slint.git#7a295d1b75121fa1b21996588511c98772488fe4"
dependencies = [
"by_address",
"codemap",
@ -2792,7 +2767,7 @@ dependencies = [
[[package]]
name = "i-slint-core"
version = "1.4.0"
source = "git+https://github.com/slint-ui/slint.git#ff2bf6849e2d6325db1650ebe3dc96137573d272"
source = "git+https://github.com/slint-ui/slint.git#7a295d1b75121fa1b21996588511c98772488fe4"
dependencies = [
"auto_enums",
"bytemuck",
@ -2829,13 +2804,13 @@ dependencies = [
"vtable",
"wasm-bindgen",
"web-sys",
"web-time",
"web-time 1.0.0",
]
[[package]]
name = "i-slint-core-macros"
version = "1.4.0"
source = "git+https://github.com/slint-ui/slint.git#ff2bf6849e2d6325db1650ebe3dc96137573d272"
source = "git+https://github.com/slint-ui/slint.git#7a295d1b75121fa1b21996588511c98772488fe4"
dependencies = [
"quote",
"syn 2.0.48",
@ -2844,7 +2819,7 @@ dependencies = [
[[package]]
name = "i-slint-renderer-femtovg"
version = "1.4.0"
source = "git+https://github.com/slint-ui/slint.git#ff2bf6849e2d6325db1650ebe3dc96137573d272"
source = "git+https://github.com/slint-ui/slint.git#7a295d1b75121fa1b21996588511c98772488fe4"
dependencies = [
"cfg-if",
"const-field-offset",
@ -2876,7 +2851,7 @@ dependencies = [
[[package]]
name = "i-slint-renderer-skia"
version = "1.4.0"
source = "git+https://github.com/slint-ui/slint.git#ff2bf6849e2d6325db1650ebe3dc96137573d272"
source = "git+https://github.com/slint-ui/slint.git#7a295d1b75121fa1b21996588511c98772488fe4"
dependencies = [
"ash",
"bytemuck",
@ -3031,9 +3006,9 @@ dependencies = [
[[package]]
name = "image"
version = "0.24.7"
version = "0.24.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711"
checksum = "034bbe799d1909622a74d1193aa50147769440040ff36cb2baa947609b0a4e23"
dependencies = [
"bytemuck",
"byteorder",
@ -3041,7 +3016,6 @@ dependencies = [
"exr",
"gif",
"jpeg-decoder",
"num-rational",
"num-traits",
"png",
"qoi",
@ -3301,9 +3275,9 @@ dependencies = [
[[package]]
name = "jpeg-decoder"
version = "0.3.0"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e"
checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0"
dependencies = [
"rayon",
]
@ -3485,7 +3459,7 @@ version = "0.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"libc",
"redox_syscall 0.4.1",
]
@ -3496,7 +3470,7 @@ version = "0.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"libc",
"redox_syscall 0.4.1",
]
@ -3534,15 +3508,15 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519"
[[package]]
name = "linux-raw-sys"
version = "0.4.12"
version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456"
checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c"
[[package]]
name = "linux-raw-sys"
version = "0.6.3"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ab96045f1fabcc9fe043d9cb6900c5e1cba5c13f6aaa3d2295b496661924464"
checksum = "f0b5399f6804fbab912acbd8878ed3532d506b7c951b8f9f164ef90fef39e3f4"
[[package]]
name = "locale_config"
@ -3732,7 +3706,7 @@ version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"block",
"core-graphics-types",
"foreign-types",
@ -3773,6 +3747,17 @@ dependencies = [
"simd-adler32",
]
[[package]]
name = "mio"
version = "0.8.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09"
dependencies = [
"libc",
"wasi",
"windows-sys 0.48.0",
]
[[package]]
name = "multicache"
version = "0.6.1"
@ -3797,7 +3782,7 @@ version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"jni-sys",
"log",
"ndk-sys",
@ -3839,7 +3824,7 @@ version = "0.27.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"cfg-if",
"libc",
]
@ -3892,17 +3877,6 @@ dependencies = [
"num-traits",
]
[[package]]
name = "num-rational"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0"
dependencies = [
"autocfg",
"num-integer",
"num-traits",
]
[[package]]
name = "num-traits"
version = "0.2.17"
@ -3928,7 +3902,7 @@ version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b"
dependencies = [
"proc-macro-crate 3.0.0",
"proc-macro-crate 3.1.0",
"proc-macro2",
"quote",
"syn 2.0.48",
@ -4010,6 +3984,15 @@ dependencies = [
"objc",
]
[[package]]
name = "object"
version = "0.32.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441"
dependencies = [
"memchr",
]
[[package]]
name = "ogg_pager"
version = "0.6.0"
@ -4281,15 +4264,15 @@ dependencies = [
[[package]]
name = "pkg-config"
version = "0.3.28"
version = "0.3.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a"
checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb"
[[package]]
name = "png"
version = "0.17.10"
version = "0.17.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64"
checksum = "1f6c3c3e617595665b8ea2ff95a86066be38fb121ff920a9c0eb282abcd1da5a"
dependencies = [
"bitflags 1.3.2",
"crc32fast",
@ -4316,9 +4299,9 @@ dependencies = [
[[package]]
name = "polling"
version = "3.3.1"
version = "3.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e"
checksum = "545c980a3880efd47b2e262f6a4bb6daad6555cf3367aa9c4e52895f69537a41"
dependencies = [
"cfg-if",
"concurrent-queue",
@ -4395,9 +4378,9 @@ dependencies = [
[[package]]
name = "proc-macro-crate"
version = "3.0.0"
version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6b2685dd208a3771337d8d386a89840f0f43cd68be8dae90a5f8c2384effc9cd"
checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284"
dependencies = [
"toml_edit 0.21.0",
]
@ -4515,9 +4498,9 @@ dependencies = [
[[package]]
name = "rayon"
version = "1.8.0"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1"
checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051"
dependencies = [
"either",
"rayon-core",
@ -4525,9 +4508,9 @@ dependencies = [
[[package]]
name = "rayon-core"
version = "1.12.0"
version = "1.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed"
checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
dependencies = [
"crossbeam-deque",
"crossbeam-utils",
@ -4637,15 +4620,13 @@ dependencies = [
[[package]]
name = "rfd"
version = "0.12.1"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c9e7b57df6e8472152674607f6cc68aa14a748a3157a857a94f516e11aeacc2"
checksum = "c0d8ab342bcc5436e04d3a4c1e09e17d74958bfaddf8d5fad6f85607df0f994f"
dependencies = [
"ashpd",
"async-io 1.13.0",
"block",
"dispatch",
"futures-util",
"js-sys",
"log",
"objc",
@ -4757,6 +4738,12 @@ dependencies = [
"walkdir",
]
[[package]]
name = "rustc-demangle"
version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
[[package]]
name = "rustc-hash"
version = "1.1.0"
@ -4839,10 +4826,10 @@ version = "0.38.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"errno",
"libc",
"linux-raw-sys 0.4.12",
"linux-raw-sys 0.4.13",
"windows-sys 0.52.0",
]
@ -4993,12 +4980,6 @@ version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0"
[[package]]
name = "send_wrapper"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73"
[[package]]
name = "serde"
version = "1.0.195"
@ -5153,7 +5134,7 @@ version = "0.69.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a3d25acaedea0a8ed1dac52f383fc90276f5679a68e3f84c5fb7f7bde8934ff"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"lazy_static",
"skia-bindings",
"winapi",
@ -5172,7 +5153,7 @@ dependencies = [
[[package]]
name = "slint"
version = "1.4.0"
source = "git+https://github.com/slint-ui/slint.git#ff2bf6849e2d6325db1650ebe3dc96137573d272"
source = "git+https://github.com/slint-ui/slint.git#7a295d1b75121fa1b21996588511c98772488fe4"
dependencies = [
"const-field-offset",
"i-slint-backend-selector",
@ -5188,7 +5169,7 @@ dependencies = [
[[package]]
name = "slint-build"
version = "1.4.0"
source = "git+https://github.com/slint-ui/slint.git#ff2bf6849e2d6325db1650ebe3dc96137573d272"
source = "git+https://github.com/slint-ui/slint.git#7a295d1b75121fa1b21996588511c98772488fe4"
dependencies = [
"i-slint-compiler",
"spin_on",
@ -5199,7 +5180,7 @@ dependencies = [
[[package]]
name = "slint-macros"
version = "1.4.0"
source = "git+https://github.com/slint-ui/slint.git#ff2bf6849e2d6325db1650ebe3dc96137573d272"
source = "git+https://github.com/slint-ui/slint.git#7a295d1b75121fa1b21996588511c98772488fe4"
dependencies = [
"i-slint-compiler",
"proc-macro2",
@ -5218,9 +5199,9 @@ dependencies = [
[[package]]
name = "smallvec"
version = "1.11.2"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970"
checksum = "2593d31f82ead8df961d8bd23a64c2ccf2eb5dd34b0a34bfb4dd54011c72009e"
[[package]]
name = "smithay-client-toolkit"
@ -5228,7 +5209,7 @@ version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60e3d9941fa3bacf7c2bf4b065304faa14164151254cd16ce1b1bc8fc381600f"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"calloop",
"calloop-wayland-source",
"cursor-icon",
@ -5260,9 +5241,9 @@ dependencies = [
[[package]]
name = "smol_str"
version = "0.2.0"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74212e6bbe9a4352329b2f68ba3130c15a3f26fe88ff22dbdc6cdd58fa85e99c"
checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49"
dependencies = [
"serde",
]
@ -5299,6 +5280,16 @@ dependencies = [
"winapi",
]
[[package]]
name = "socket2"
version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9"
dependencies = [
"libc",
"windows-sys 0.48.0",
]
[[package]]
name = "softbuffer"
version = "0.3.4"
@ -5734,9 +5725,9 @@ dependencies = [
[[package]]
name = "tiff"
version = "0.9.0"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211"
checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e"
dependencies = [
"flate2",
"jpeg-decoder",
@ -5836,6 +5827,23 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
version = "1.35.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104"
dependencies = [
"backtrace",
"bytes",
"libc",
"mio",
"pin-project-lite",
"signal-hook-registry",
"socket2 0.5.5",
"tracing",
"windows-sys 0.48.0",
]
[[package]]
name = "toml"
version = "0.5.11"
@ -5974,9 +5982,9 @@ dependencies = [
[[package]]
name = "trash"
version = "3.2.0"
version = "3.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e7b1a28f9550f43ac27987f2144d7798520c6dee6a7eb1dedfe3131e3c257e3"
checksum = "55bb920006929bc37df8c151c3c063b6fc10f485dfe4937393f905861a632e53"
dependencies = [
"chrono",
"libc",
@ -6092,9 +6100,9 @@ dependencies = [
[[package]]
name = "unicode-bidi"
version = "0.3.14"
version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416"
checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75"
[[package]]
name = "unicode-bidi-mirroring"
@ -6319,7 +6327,7 @@ dependencies = [
[[package]]
name = "vtable"
version = "0.1.11"
source = "git+https://github.com/slint-ui/slint.git#ff2bf6849e2d6325db1650ebe3dc96137573d272"
source = "git+https://github.com/slint-ui/slint.git#7a295d1b75121fa1b21996588511c98772488fe4"
dependencies = [
"const-field-offset",
"portable-atomic",
@ -6330,7 +6338,7 @@ dependencies = [
[[package]]
name = "vtable-macro"
version = "0.1.10"
source = "git+https://github.com/slint-ui/slint.git#ff2bf6849e2d6325db1650ebe3dc96137573d272"
source = "git+https://github.com/slint-ui/slint.git#7a295d1b75121fa1b21996588511c98772488fe4"
dependencies = [
"proc-macro2",
"quote",
@ -6474,7 +6482,7 @@ version = "0.31.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ca7d52347346f5473bf2f56705f360e8440873052e575e55890c4fa57843ed3"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"nix 0.26.4",
"wayland-backend",
"wayland-scanner",
@ -6486,7 +6494,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"cursor-icon",
"wayland-backend",
]
@ -6508,7 +6516,7 @@ version = "0.31.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e253d7107ba913923dc253967f35e8561a3c65f914543e46843c88ddd729e21c"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"wayland-backend",
"wayland-client",
"wayland-scanner",
@ -6520,7 +6528,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"wayland-backend",
"wayland-client",
"wayland-protocols",
@ -6533,7 +6541,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"wayland-backend",
"wayland-client",
"wayland-protocols",
@ -6583,6 +6591,16 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "web-time"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ee269d72cc29bf77a2c4bc689cc750fb39f5cbd493d2205bbb3f5c7779cf7b0"
dependencies = [
"js-sys",
"wasm-bindgen",
]
[[package]]
name = "webpki-roots"
version = "0.25.3"
@ -6874,14 +6892,14 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
[[package]]
name = "winit"
version = "0.29.9"
version = "0.29.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2376dab13e09c01ad8b679f0dbc7038af4ec43d9a91344338e37bd686481550"
checksum = "4c824f11941eeae66ec71111cc2674373c772f482b58939bb4066b642aa2ffcf"
dependencies = [
"ahash",
"android-activity",
"atomic-waker",
"bitflags 2.4.1",
"bitflags 2.4.2",
"bytemuck",
"calloop",
"cfg_aliases 0.1.1",
@ -6913,7 +6931,7 @@ dependencies = [
"wayland-protocols",
"wayland-protocols-plasma",
"web-sys",
"web-time",
"web-time 0.2.4",
"windows-sys 0.48.0",
"x11-dl",
"x11rb 0.13.0",
@ -7007,12 +7025,12 @@ checksum = "e63e71c4b8bd9ffec2c963173a4dc4cbde9ee96961d4fcb4429db9929b606c34"
[[package]]
name = "xattr"
version = "1.2.0"
version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "914566e6413e7fa959cc394fb30e563ba80f3541fbd40816d4c05a0fc3f2a0f1"
checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f"
dependencies = [
"libc",
"linux-raw-sys 0.4.12",
"linux-raw-sys 0.4.13",
"rustix 0.38.30",
]
@ -7049,7 +7067,7 @@ version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6924668544c48c0133152e7eec86d644a056ca3d09275eb8d5cdb9855f9d8699"
dependencies = [
"bitflags 2.4.1",
"bitflags 2.4.2",
"dlib",
"log",
"once_cell",
@ -7102,15 +7120,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "31de390a2d872e4cd04edd71b425e29853f786dc99317ed72d73d6fcf5ebb948"
dependencies = [
"async-broadcast",
"async-executor",
"async-fs 1.6.0",
"async-io 1.13.0",
"async-lock 2.8.0",
"async-process",
"async-recursion",
"async-task",
"async-trait",
"blocking",
"byteorder",
"derivative",
"enumflags2",
@ -7127,6 +7139,7 @@ dependencies = [
"serde_repr",
"sha1",
"static_assertions",
"tokio",
"tracing",
"uds_windows",
"winapi",

View File

@ -424,6 +424,8 @@ pub struct CommonCliItems {
long_help = "List of checked files with provided extension(s). There are also helpful macros which allow to easy use a typical extensions like:\nIMAGE(\"jpg,kra,gif,png,bmp,tiff,hdr,svg\"),\nTEXT(\"txt,doc,docx,odt,rtf\"),\nVIDEO(\"mp4,flv,mkv,webm,vob,ogv,gifv,avi,mov,wmv,mpg,m4v,m4p,mpeg,3gp\") or\nMUSIC(\"mp3,flac,ogg,tta,wma,webm\")\n "
)]
pub allowed_extensions: Vec<String>,
#[clap(short = 'E', long, help = "Excluded file extension(s)", long_help = "List of extensions, that will be removed from search.\n ")]
pub excluded_extensions: Vec<String>,
#[clap(flatten)]
pub file_to_save: FileToSave,
#[clap(flatten)]

View File

@ -195,7 +195,7 @@ impl BadExtensions {
#[fun_time(message = "find_bad_extensions_files", level = "info")]
pub fn find_bad_extensions_files(&mut self, stop_receiver: Option<&Receiver<()>>, progress_sender: Option<&Sender<ProgressData>>) {
self.optimize_dirs_before_start();
self.prepare_items();
if !self.check_files(stop_receiver, progress_sender) {
self.common_data.stopped_search = true;
return;

View File

@ -43,7 +43,7 @@ impl BigFile {
#[fun_time(message = "find_big_files", level = "info")]
pub fn find_big_files(&mut self, stop_receiver: Option<&Receiver<()>>, progress_sender: Option<&Sender<ProgressData>>) {
self.optimize_dirs_before_start();
self.prepare_items();
if !self.look_for_big_files(stop_receiver, progress_sender) {
self.common_data.stopped_search = true;
return;

View File

@ -106,7 +106,7 @@ impl BrokenFiles {
#[fun_time(message = "find_broken_files", level = "info")]
pub fn find_broken_files(&mut self, stop_receiver: Option<&Receiver<()>>, progress_sender: Option<&Sender<ProgressData>>) {
self.optimize_dirs_before_start();
self.prepare_items();
if !self.check_files(stop_receiver, progress_sender) {
self.common_data.stopped_search = true;
return;
@ -139,8 +139,8 @@ impl BrokenFiles {
}
}
self.common_data.allowed_extensions.set_and_validate_extensions(&extensions);
if !self.common_data.allowed_extensions.set_any_extensions() {
self.common_data.extensions.set_and_validate_allowed_extensions(&extensions);
if !self.common_data.extensions.set_any_extensions() {
return true;
}

View File

@ -17,7 +17,7 @@ use crossbeam_channel::Sender;
use directories_next::ProjectDirs;
use fun_time::fun_time;
use handsome_logger::{ColorChoice, ConfigBuilder, TerminalMode};
use image::{DynamicImage, ImageBuffer};
use image::{DynamicImage, ImageBuffer, Rgb};
use imagepipe::{ImageSource, Pipeline};
#[cfg(feature = "heif")]
use libheif_rs::{ColorSpace, HeifContext, RgbChroma};

View File

@ -112,7 +112,7 @@ pub struct DirTraversalBuilder<'a, 'b, F> {
recursive_search: bool,
directories: Option<Directories>,
excluded_items: Option<ExcludedItems>,
allowed_extensions: Option<Extensions>,
extensions: Option<Extensions>,
tool_type: ToolType,
}
@ -124,7 +124,7 @@ pub struct DirTraversal<'a, 'b, F> {
recursive_search: bool,
directories: Directories,
excluded_items: ExcludedItems,
allowed_extensions: Extensions,
extensions: Extensions,
minimal_file_size: u64,
maximal_file_size: u64,
checking_method: CheckingMethod,
@ -153,7 +153,7 @@ impl<'a, 'b> DirTraversalBuilder<'a, 'b, ()> {
collect: Collect::Files,
recursive_search: false,
directories: None,
allowed_extensions: None,
extensions: None,
excluded_items: None,
tool_type: ToolType::None,
}
@ -168,7 +168,7 @@ impl<'a, 'b, F> DirTraversalBuilder<'a, 'b, F> {
pub fn common_data(mut self, common_tool_data: &CommonToolData) -> Self {
self.root_dirs = common_tool_data.directories.included_directories.clone();
self.allowed_extensions = Some(common_tool_data.allowed_extensions.clone());
self.extensions = Some(common_tool_data.extensions.clone());
self.excluded_items = Some(common_tool_data.excluded_items.clone());
self.recursive_search = common_tool_data.recursive_search;
self.minimal_file_size = Some(common_tool_data.minimal_file_size);
@ -218,8 +218,8 @@ impl<'a, 'b, F> DirTraversalBuilder<'a, 'b, F> {
self
}
pub fn allowed_extensions(mut self, allowed_extensions: Extensions) -> Self {
self.allowed_extensions = Some(allowed_extensions);
pub fn extensions(mut self, extensions: Extensions) -> Self {
self.extensions = Some(extensions);
self
}
@ -257,7 +257,7 @@ impl<'a, 'b, F> DirTraversalBuilder<'a, 'b, F> {
stop_receiver: self.stop_receiver,
progress_sender: self.progress_sender,
directories: self.directories,
allowed_extensions: self.allowed_extensions,
extensions: self.extensions,
excluded_items: self.excluded_items,
recursive_search: self.recursive_search,
maximal_file_size: self.maximal_file_size,
@ -282,7 +282,7 @@ impl<'a, 'b, F> DirTraversalBuilder<'a, 'b, F> {
collect: self.collect,
directories: self.directories.expect("could not build"),
excluded_items: self.excluded_items.expect("could not build"),
allowed_extensions: self.allowed_extensions.unwrap_or_default(),
extensions: self.extensions.unwrap_or_default(),
recursive_search: self.recursive_search,
tool_type: self.tool_type,
}
@ -331,7 +331,7 @@ where
collect,
directories,
excluded_items,
allowed_extensions,
extensions,
recursive_search,
minimal_file_size,
maximal_file_size,
@ -374,7 +374,7 @@ where
entry_data,
&mut warnings,
&mut fe_result,
&allowed_extensions,
&extensions,
&directories,
&excluded_items,
minimal_file_size,
@ -386,7 +386,7 @@ where
}
(EntryType::Symlink, Collect::InvalidSymlinks) => {
counter += 1;
process_symlink_in_symlink_mode(entry_data, &mut warnings, &mut fe_result, &allowed_extensions, &directories, &excluded_items);
process_symlink_in_symlink_mode(entry_data, &mut warnings, &mut fe_result, &extensions, &directories, &excluded_items);
}
(EntryType::Symlink, Collect::Files) | (EntryType::Other, _) => {
// nothing to do
@ -432,13 +432,13 @@ fn process_file_in_file_mode(
entry_data: &DirEntry,
warnings: &mut Vec<String>,
fe_result: &mut Vec<FileEntry>,
allowed_extensions: &Extensions,
extensions: &Extensions,
directories: &Directories,
excluded_items: &ExcludedItems,
minimal_file_size: u64,
maximal_file_size: u64,
) {
if !allowed_extensions.check_if_entry_ends_with_extension(entry_data) {
if !extensions.check_if_entry_have_valid_extension(entry_data) {
return;
}
@ -509,11 +509,11 @@ fn process_symlink_in_symlink_mode(
entry_data: &DirEntry,
warnings: &mut Vec<String>,
fe_result: &mut Vec<FileEntry>,
allowed_extensions: &Extensions,
extensions: &Extensions,
directories: &Directories,
excluded_items: &ExcludedItems,
) {
if !allowed_extensions.check_if_entry_ends_with_extension(entry_data) {
if !extensions.check_if_entry_have_valid_extension(entry_data) {
return;
}

View File

@ -5,34 +5,35 @@ use crate::common_messages::Messages;
#[derive(Debug, Clone, Default)]
pub struct Extensions {
file_extensions_hashset: HashSet<String>,
allowed_extensions_hashset: HashSet<String>,
excluded_extensions_hashset: HashSet<String>,
}
impl Extensions {
pub fn new() -> Self {
Default::default()
}
/// List of allowed extensions, only files with this extensions will be checking if are duplicates
/// After, extensions cannot contains any dot, commas etc.
pub fn set_allowed_extensions(&mut self, mut allowed_extensions: String) -> Messages {
pub fn filter_extensions(mut file_extensions: String) -> (HashSet<String>, Messages) {
let mut messages = Messages::new();
let mut extensions_hashset = HashSet::new();
if allowed_extensions.trim().is_empty() {
return messages;
if file_extensions.trim().is_empty() {
return (Default::default(), messages);
}
allowed_extensions = allowed_extensions.replace("IMAGE", "jpg,kra,gif,png,bmp,tiff,hdr,svg");
allowed_extensions = allowed_extensions.replace("VIDEO", "mp4,flv,mkv,webm,vob,ogv,gifv,avi,mov,wmv,mpg,m4v,m4p,mpeg,3gp");
allowed_extensions = allowed_extensions.replace("MUSIC", "mp3,flac,ogg,tta,wma,webm");
allowed_extensions = allowed_extensions.replace("TEXT", "txt,doc,docx,odt,rtf");
file_extensions = file_extensions.replace("IMAGE", "jpg,kra,gif,png,bmp,tiff,hdr,svg");
file_extensions = file_extensions.replace("VIDEO", "mp4,flv,mkv,webm,vob,ogv,gifv,avi,mov,wmv,mpg,m4v,m4p,mpeg,3gp");
file_extensions = file_extensions.replace("MUSIC", "mp3,flac,ogg,tta,wma,webm");
file_extensions = file_extensions.replace("TEXT", "txt,doc,docx,odt,rtf");
let extensions: Vec<String> = allowed_extensions.split(',').map(str::trim).map(String::from).collect();
let extensions: Vec<String> = file_extensions.split(',').map(str::trim).map(String::from).collect();
for mut extension in extensions {
if extension.is_empty() || extension.replace(['.', ' '], "").trim().is_empty() {
continue;
}
if extension.starts_with('.') {
extension = extension[1..].to_string();
extension = extension.chars().skip(1).collect::<String>();
}
if extension.contains('.') {
@ -45,10 +46,18 @@ impl Extensions {
continue;
}
self.file_extensions_hashset.insert(extension);
extensions_hashset.insert(extension);
}
(extensions_hashset, messages)
}
if self.file_extensions_hashset.is_empty() {
/// List of allowed extensions, only files with this extensions will be checking if are duplicates
/// After, extensions cannot contains any dot, commas etc.
pub fn set_allowed_extensions(&mut self, allowed_extensions: String) -> Messages {
let (extensions, mut messages) = Self::filter_extensions(allowed_extensions);
self.allowed_extensions_hashset = extensions;
if self.allowed_extensions_hashset.is_empty() {
messages
.messages
.push("No valid extensions were provided, so allowing all extensions by default.".to_string());
@ -56,38 +65,47 @@ impl Extensions {
messages
}
pub fn matches_filename(&self, file_name: &str) -> bool {
// assert_eq!(file_name, file_name.to_lowercase());
if !self.file_extensions_hashset.is_empty() && !self.file_extensions_hashset.iter().any(|e| file_name.ends_with(e)) {
return false;
}
true
pub fn set_excluded_extensions(&mut self, excluded_extensions: String) -> Messages {
let (extensions, messages) = Self::filter_extensions(excluded_extensions);
self.excluded_extensions_hashset = extensions;
messages
}
pub fn check_if_entry_ends_with_extension(&self, entry_data: &DirEntry) -> bool {
if self.file_extensions_hashset.is_empty() {
pub fn check_if_entry_have_valid_extension(&self, entry_data: &DirEntry) -> bool {
if self.allowed_extensions_hashset.is_empty() && self.excluded_extensions_hashset.is_empty() {
return true;
}
// Using entry_data.path().extension() is a lot of slower, even 5 times
let file_name = entry_data.file_name();
let Some(file_name_str) = file_name.to_str() else { return false };
let Some(extension_idx) = file_name_str.rfind('.') else { return false };
let extension = &file_name_str[extension_idx + 1..];
if extension.chars().all(|c| c.is_ascii_lowercase()) {
self.file_extensions_hashset.contains(extension)
if !self.allowed_extensions_hashset.is_empty() {
if extension.chars().all(|c| c.is_ascii_lowercase()) {
self.allowed_extensions_hashset.contains(extension)
} else {
self.allowed_extensions_hashset.contains(&extension.to_lowercase())
}
} else {
self.file_extensions_hashset.contains(&extension.to_lowercase())
if extension.chars().all(|c| c.is_ascii_lowercase()) {
!self.excluded_extensions_hashset.contains(extension)
} else {
!self.excluded_extensions_hashset.contains(&extension.to_lowercase())
}
}
}
pub fn set_any_extensions(&self) -> bool {
!self.file_extensions_hashset.is_empty()
!self.allowed_extensions_hashset.is_empty()
}
fn extend_allowed_extensions(&mut self, file_extensions: &[&str]) {
for extension in file_extensions {
let extension_without_dot = extension.trim_start_matches('.');
self.file_extensions_hashset.insert(extension_without_dot.to_string());
self.allowed_extensions_hashset.insert(extension_without_dot.to_string());
}
}
@ -101,8 +119,8 @@ impl Extensions {
}
}
pub fn set_and_validate_extensions(&mut self, file_extensions: &[&str]) {
if self.file_extensions_hashset.is_empty() {
pub fn set_and_validate_allowed_extensions(&mut self, file_extensions: &[&str]) {
if self.allowed_extensions_hashset.is_empty() {
self.extend_allowed_extensions(file_extensions);
} else {
self.union_allowed_extensions(file_extensions);

View File

@ -11,7 +11,7 @@ pub struct CommonToolData {
pub(crate) tool_type: ToolType,
pub(crate) text_messages: Messages,
pub(crate) directories: Directories,
pub(crate) allowed_extensions: Extensions,
pub(crate) extensions: Extensions,
pub(crate) excluded_items: ExcludedItems,
pub(crate) recursive_search: bool,
pub(crate) delete_method: DeleteMethod,
@ -43,7 +43,7 @@ impl CommonToolData {
tool_type,
text_messages: Messages::new(),
directories: Directories::new(),
allowed_extensions: Extensions::new(),
extensions: Extensions::new(),
excluded_items: ExcludedItems::new(),
recursive_search: true,
delete_method: DeleteMethod::None,
@ -168,7 +168,11 @@ pub trait CommonData {
self.get_cd_mut().text_messages.extend_with_another_messages(messages);
}
fn set_allowed_extensions(&mut self, allowed_extensions: String) {
let messages = self.get_cd_mut().allowed_extensions.set_allowed_extensions(allowed_extensions);
let messages = self.get_cd_mut().extensions.set_allowed_extensions(allowed_extensions);
self.get_cd_mut().text_messages.extend_with_another_messages(messages);
}
fn set_excluded_extensions(&mut self, excluded_extensions: String) {
let messages = self.get_cd_mut().extensions.set_excluded_extensions(excluded_extensions);
self.get_cd_mut().text_messages.extend_with_another_messages(messages);
}
@ -177,8 +181,9 @@ pub trait CommonData {
self.get_cd_mut().text_messages.extend_with_another_messages(messages);
}
fn optimize_dirs_before_start(&mut self) {
fn prepare_items(&mut self) {
let recursive_search = self.get_cd().recursive_search;
// Optimizes directories and removes recursive calls
let messages = self.get_cd_mut().directories.optimize_directories(recursive_search);
self.get_cd_mut().text_messages.extend_with_another_messages(messages);
}
@ -187,7 +192,7 @@ pub trait CommonData {
println!("---------------DEBUG PRINT COMMON---------------");
println!("Tool type: {:?}", self.get_cd().tool_type);
println!("Directories: {:?}", self.get_cd().directories);
println!("Allowed extensions: {:?}", self.get_cd().allowed_extensions);
println!("Extensions: {:?}", self.get_cd().extensions);
println!("Excluded items: {:?}", self.get_cd().excluded_items);
println!("Recursive search: {:?}", self.get_cd().recursive_search);
println!("Maximal file size: {:?}", self.get_cd().maximal_file_size);

View File

@ -142,7 +142,7 @@ impl DuplicateFinder {
#[fun_time(message = "find_duplicates", level = "info")]
pub fn find_duplicates(&mut self, stop_receiver: Option<&Receiver<()>>, progress_sender: Option<&Sender<ProgressData>>) {
self.optimize_dirs_before_start();
self.prepare_items();
self.common_data.use_reference_folders = !self.common_data.directories.reference_directories.is_empty();
match self.check_method {

View File

@ -40,7 +40,7 @@ impl EmptyFiles {
#[fun_time(message = "find_empty_files", level = "info")]
pub fn find_empty_files(&mut self, stop_receiver: Option<&Receiver<()>>, progress_sender: Option<&Sender<ProgressData>>) {
self.optimize_dirs_before_start();
self.prepare_items();
if !self.check_files(stop_receiver, progress_sender) {
self.common_data.stopped_search = true;
return;

View File

@ -64,7 +64,7 @@ impl EmptyFolder {
#[fun_time(message = "find_empty_folders", level = "info")]
pub fn find_empty_folders(&mut self, stop_receiver: Option<&Receiver<()>>, progress_sender: Option<&Sender<ProgressData>>) {
self.optimize_dirs_before_start();
self.prepare_items();
if !self.check_for_empty_folders(stop_receiver, progress_sender) {
self.common_data.stopped_search = true;
return;

View File

@ -72,7 +72,7 @@ impl InvalidSymlinks {
#[fun_time(message = "find_invalid_links", level = "info")]
pub fn find_invalid_links(&mut self, stop_receiver: Option<&Receiver<()>>, progress_sender: Option<&Sender<ProgressData>>) {
self.optimize_dirs_before_start();
self.prepare_items();
if !self.check_files(stop_receiver, progress_sender) {
self.common_data.stopped_search = true;
return;

View File

@ -136,7 +136,7 @@ impl SameMusic {
#[fun_time(message = "find_same_music", level = "info")]
pub fn find_same_music(&mut self, stop_receiver: Option<&Receiver<()>>, progress_sender: Option<&Sender<ProgressData>>) {
self.optimize_dirs_before_start();
self.prepare_items();
self.common_data.use_reference_folders = !self.common_data.directories.reference_directories.is_empty();
if !self.check_files(stop_receiver, progress_sender) {
self.common_data.stopped_search = true;
@ -175,8 +175,8 @@ impl SameMusic {
#[fun_time(message = "check_files", level = "debug")]
fn check_files(&mut self, stop_receiver: Option<&Receiver<()>>, progress_sender: Option<&Sender<ProgressData>>) -> bool {
self.common_data.allowed_extensions.set_and_validate_extensions(AUDIO_FILES_EXTENSIONS);
if !self.common_data.allowed_extensions.set_any_extensions() {
self.common_data.extensions.set_and_validate_allowed_extensions(AUDIO_FILES_EXTENSIONS);
if !self.common_data.extensions.set_any_extensions() {
return true;
}

View File

@ -149,7 +149,7 @@ impl SimilarImages {
#[fun_time(message = "find_similar_images", level = "info")]
pub fn find_similar_images(&mut self, stop_receiver: Option<&Receiver<()>>, progress_sender: Option<&Sender<ProgressData>>) {
self.optimize_dirs_before_start();
self.prepare_items();
self.common_data.use_reference_folders = !self.common_data.directories.reference_directories.is_empty();
if !self.check_for_similar_images(stop_receiver, progress_sender) {
self.common_data.stopped_search = true;
@ -171,14 +171,14 @@ impl SimilarImages {
fn check_for_similar_images(&mut self, stop_receiver: Option<&Receiver<()>>, progress_sender: Option<&Sender<ProgressData>>) -> bool {
if cfg!(feature = "heif") {
self.common_data
.allowed_extensions
.set_and_validate_extensions(&[IMAGE_RS_SIMILAR_IMAGES_EXTENSIONS, RAW_IMAGE_EXTENSIONS, HEIC_EXTENSIONS].concat());
.extensions
.set_and_validate_allowed_extensions(&[IMAGE_RS_SIMILAR_IMAGES_EXTENSIONS, RAW_IMAGE_EXTENSIONS, HEIC_EXTENSIONS].concat());
} else {
self.common_data
.allowed_extensions
.set_and_validate_extensions(&[IMAGE_RS_SIMILAR_IMAGES_EXTENSIONS, RAW_IMAGE_EXTENSIONS].concat());
.extensions
.set_and_validate_allowed_extensions(&[IMAGE_RS_SIMILAR_IMAGES_EXTENSIONS, RAW_IMAGE_EXTENSIONS].concat());
}
if !self.common_data.allowed_extensions.set_any_extensions() {
if !self.common_data.extensions.set_any_extensions() {
return true;
}

View File

@ -125,7 +125,7 @@ impl SimilarVideos {
.errors
.push(flc!("core_ffmpeg_missing_in_snap", url = "https://github.com/snapcrafters/ffmpeg/issues/73"));
} else {
self.optimize_dirs_before_start();
self.prepare_items();
self.common_data.use_reference_folders = !self.common_data.directories.reference_directories.is_empty();
if !self.check_for_similar_videos(stop_receiver, progress_sender) {
self.common_data.stopped_search = true;
@ -142,8 +142,8 @@ impl SimilarVideos {
// #[fun_time(message = "check_for_similar_videos", level = "debug")]
fn check_for_similar_videos(&mut self, stop_receiver: Option<&Receiver<()>>, progress_sender: Option<&Sender<ProgressData>>) -> bool {
self.common_data.allowed_extensions.set_and_validate_extensions(VIDEO_FILES_EXTENSIONS);
if !self.common_data.allowed_extensions.set_any_extensions() {
self.common_data.extensions.set_and_validate_allowed_extensions(VIDEO_FILES_EXTENSIONS);
if !self.common_data.extensions.set_any_extensions() {
return true;
}

View File

@ -59,7 +59,7 @@ impl Temporary {
#[fun_time(message = "find_temporary_files", level = "info")]
pub fn find_temporary_files(&mut self, stop_receiver: Option<&Receiver<()>>, progress_sender: Option<&Sender<ProgressData>>) {
self.optimize_dirs_before_start();
self.prepare_items();
if !self.check_files(stop_receiver, progress_sender) {
self.common_data.stopped_search = true;
return;

View File

@ -17,7 +17,7 @@ chrono = "0.4.31"
open = "5.0"
crossbeam-channel = "0.5"
handsome_logger = "0.8"
rfd = { version = "0.12", default-features = false, features = ["xdg-portal"] }
rfd = { version = "0.13", default-features = false, features = ["xdg-portal", "tokio"] }
home = "0.5"
log = "0.4.20"
serde = "1.0"
@ -26,7 +26,7 @@ humansize = "2.1"
image = "0.24"
directories-next = "2.0"
image_hasher = "1.2"
rayon = "1.8.0"
rayon = "1.8"
# Translations
i18n-embed = { version = "0.14", features = ["fluent-system", "desktop-requester"] }