Update to upstream trash-rs
This commit is contained in:
parent
4c664689c6
commit
69531644ff
3 changed files with 36 additions and 35 deletions
51
Cargo.lock
generated
51
Cargo.lock
generated
|
|
@ -323,7 +323,7 @@ version = "1.8.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c"
|
||||
dependencies = [
|
||||
"async-lock 3.2.0",
|
||||
"async-lock 3.3.0",
|
||||
"async-task",
|
||||
"concurrent-queue",
|
||||
"fastrand 2.0.1",
|
||||
|
|
@ -369,7 +369,7 @@ version = "2.2.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6afaa937395a620e33dc6a742c593c01aced20aa376ffb0f628121198578ccc7"
|
||||
dependencies = [
|
||||
"async-lock 3.2.0",
|
||||
"async-lock 3.3.0",
|
||||
"cfg-if 1.0.0",
|
||||
"concurrent-queue",
|
||||
"futures-io",
|
||||
|
|
@ -393,9 +393,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "async-lock"
|
||||
version = "3.2.0"
|
||||
version = "3.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c"
|
||||
checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b"
|
||||
dependencies = [
|
||||
"event-listener 4.0.3",
|
||||
"event-listener-strategy",
|
||||
|
|
@ -612,7 +612,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118"
|
||||
dependencies = [
|
||||
"async-channel 2.1.1",
|
||||
"async-lock 3.2.0",
|
||||
"async-lock 3.3.0",
|
||||
"async-task",
|
||||
"fastrand 2.0.1",
|
||||
"futures-io",
|
||||
|
|
@ -941,7 +941,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-config"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#68c760e65203c5124844c2083224d8c83010ed1e"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#6850e53855ad5884d89a5bd5eeeed08a0705004c"
|
||||
dependencies = [
|
||||
"atomicwrites",
|
||||
"cosmic-config-derive",
|
||||
|
|
@ -956,7 +956,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-config-derive"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#68c760e65203c5124844c2083224d8c83010ed1e"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#6850e53855ad5884d89a5bd5eeeed08a0705004c"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
|
|
@ -1007,7 +1007,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "cosmic-theme"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#68c760e65203c5124844c2083224d8c83010ed1e"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#6850e53855ad5884d89a5bd5eeeed08a0705004c"
|
||||
dependencies = [
|
||||
"almost",
|
||||
"cosmic-config",
|
||||
|
|
@ -2310,7 +2310,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#68c760e65203c5124844c2083224d8c83010ed1e"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#6850e53855ad5884d89a5bd5eeeed08a0705004c"
|
||||
dependencies = [
|
||||
"iced_accessibility",
|
||||
"iced_core",
|
||||
|
|
@ -2325,7 +2325,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_accessibility"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#68c760e65203c5124844c2083224d8c83010ed1e"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#6850e53855ad5884d89a5bd5eeeed08a0705004c"
|
||||
dependencies = [
|
||||
"accesskit",
|
||||
"accesskit_winit",
|
||||
|
|
@ -2334,7 +2334,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_core"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#68c760e65203c5124844c2083224d8c83010ed1e"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#6850e53855ad5884d89a5bd5eeeed08a0705004c"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"instant",
|
||||
|
|
@ -2350,7 +2350,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_futures"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#68c760e65203c5124844c2083224d8c83010ed1e"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#6850e53855ad5884d89a5bd5eeeed08a0705004c"
|
||||
dependencies = [
|
||||
"futures",
|
||||
"iced_core",
|
||||
|
|
@ -2363,7 +2363,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_graphics"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#68c760e65203c5124844c2083224d8c83010ed1e"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#6850e53855ad5884d89a5bd5eeeed08a0705004c"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"bytemuck",
|
||||
|
|
@ -2386,7 +2386,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_renderer"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#68c760e65203c5124844c2083224d8c83010ed1e"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#6850e53855ad5884d89a5bd5eeeed08a0705004c"
|
||||
dependencies = [
|
||||
"iced_graphics",
|
||||
"iced_tiny_skia",
|
||||
|
|
@ -2399,7 +2399,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_runtime"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#68c760e65203c5124844c2083224d8c83010ed1e"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#6850e53855ad5884d89a5bd5eeeed08a0705004c"
|
||||
dependencies = [
|
||||
"iced_core",
|
||||
"iced_futures",
|
||||
|
|
@ -2409,7 +2409,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_style"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#68c760e65203c5124844c2083224d8c83010ed1e"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#6850e53855ad5884d89a5bd5eeeed08a0705004c"
|
||||
dependencies = [
|
||||
"iced_core",
|
||||
"once_cell",
|
||||
|
|
@ -2419,7 +2419,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_tiny_skia"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#68c760e65203c5124844c2083224d8c83010ed1e"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#6850e53855ad5884d89a5bd5eeeed08a0705004c"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"cosmic-text",
|
||||
|
|
@ -2437,7 +2437,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_wgpu"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#68c760e65203c5124844c2083224d8c83010ed1e"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#6850e53855ad5884d89a5bd5eeeed08a0705004c"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"bytemuck",
|
||||
|
|
@ -2457,7 +2457,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_widget"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#68c760e65203c5124844c2083224d8c83010ed1e"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#6850e53855ad5884d89a5bd5eeeed08a0705004c"
|
||||
dependencies = [
|
||||
"iced_renderer",
|
||||
"iced_runtime",
|
||||
|
|
@ -2471,7 +2471,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "iced_winit"
|
||||
version = "0.12.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#68c760e65203c5124844c2083224d8c83010ed1e"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#6850e53855ad5884d89a5bd5eeeed08a0705004c"
|
||||
dependencies = [
|
||||
"iced_graphics",
|
||||
"iced_runtime",
|
||||
|
|
@ -2768,7 +2768,7 @@ checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7"
|
|||
[[package]]
|
||||
name = "libcosmic"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#68c760e65203c5124844c2083224d8c83010ed1e"
|
||||
source = "git+https://github.com/pop-os/libcosmic.git#6850e53855ad5884d89a5bd5eeeed08a0705004c"
|
||||
dependencies = [
|
||||
"apply",
|
||||
"ashpd",
|
||||
|
|
@ -4752,9 +4752,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "termcolor"
|
||||
version = "1.4.0"
|
||||
version = "1.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449"
|
||||
checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
|
||||
dependencies = [
|
||||
"winapi-util",
|
||||
]
|
||||
|
|
@ -4993,8 +4993,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "trash"
|
||||
version = "3.1.2"
|
||||
source = "git+https://github.com/jackpot51/trash-rs#63639c3337cc282a1aaa69ef5afd00f8516e3dcd"
|
||||
version = "3.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6e7b1a28f9550f43ac27987f2144d7798520c6dee6a7eb1dedfe3131e3c257e3"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"libc",
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ lexical-sort = "0.3.1"
|
|||
log = "0.4"
|
||||
serde = { version = "1", features = ["serde_derive"] }
|
||||
tokio = { version = "1" }
|
||||
trash = "3.1.2"
|
||||
trash = "3.2.0"
|
||||
# Internationalization
|
||||
i18n-embed = { version = "0.13", features = ["fluent-system", "desktop-requester"] }
|
||||
i18n-embed-fl = "0.6"
|
||||
|
|
@ -34,8 +34,6 @@ wgpu = ["libcosmic/wgpu"]
|
|||
|
||||
[patch.crates-io]
|
||||
smithay-client-toolkit = { git = "https://github.com/pop-os/client-toolkit", branch = "wayland-resize" }
|
||||
# https://github.com/Byron/trash-rs/pull/95
|
||||
trash = { git = "https://github.com/jackpot51/trash-rs" }
|
||||
|
||||
[profile.release-with-debug]
|
||||
inherits = "release"
|
||||
|
|
|
|||
16
src/tab.rs
16
src/tab.rs
|
|
@ -296,16 +296,15 @@ pub fn scan_trash() -> Vec<Item> {
|
|||
let name = entry.name;
|
||||
|
||||
//TODO: configurable size
|
||||
let (icon_handle_grid, icon_handle_list) = if metadata.is_dir {
|
||||
(
|
||||
let (icon_handle_grid, icon_handle_list) = match metadata.size {
|
||||
trash::TrashItemSize::Entries(_) => (
|
||||
folder_icon(&path, ICON_SIZE_GRID),
|
||||
folder_icon(&path, ICON_SIZE_LIST),
|
||||
)
|
||||
} else {
|
||||
(
|
||||
),
|
||||
trash::TrashItemSize::Bytes(_) => (
|
||||
mime_icon(&path, ICON_SIZE_GRID),
|
||||
mime_icon(&path, ICON_SIZE_LIST),
|
||||
)
|
||||
),
|
||||
};
|
||||
|
||||
items.push(Item {
|
||||
|
|
@ -364,7 +363,10 @@ impl ItemMetadata {
|
|||
pub fn is_dir(&self) -> bool {
|
||||
match self {
|
||||
Self::Path(metadata, _) => metadata.is_dir(),
|
||||
Self::Trash(metadata) => metadata.is_dir,
|
||||
Self::Trash(metadata) => match metadata.size {
|
||||
trash::TrashItemSize::Entries(_) => true,
|
||||
trash::TrashItemSize::Bytes(_) => false,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue