Bug 469598

Summary: The "Delete Oldest Files From Trash" option does nothing
Product: [Frameworks and Libraries] frameworks-kio Reporter: Antti Savolainen <antti.savo>
Component: TrashAssignee: Antti Savolainen <antti.savo>
Status: RESOLVED FIXED    
Severity: normal CC: kdelibs-bugs-null, nate, unsaved4197+6p4t3t5q, voidpointertonull+bugskdeorg, zhangpan
Priority: NOR    
Version First Reported In: 6.10.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=504785
Latest Commit: Version Fixed/Implemented In: 6.19
Sentry Crash Report:

Description Antti Savolainen 2023-05-10 19:34:42 UTC
Demonstrative video: https://youtu.be/LXIqVJu61v4

SUMMARY
All of the options only show a warning and require a manual intervention by emptying the trash. This also applies to the "Delete Biggest Files From Trash" option.

STEPS TO REPRODUCE
1. Set "Delete Oldest Files From Trash" option for trash
2. Try to trash files past the trash size limit

OBSERVED RESULT
A warning is shown

EXPECTED RESULT
The olders/biggest file should be deleted from trash and the new file put into trash without a warning

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
(available in About System)
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.9
Comment 1 Bug Janitor Service 2025-09-25 09:23:35 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/2006
Comment 2 Pan Zhang 2025-09-26 01:04:11 UTC
I reproduced this issue on the master branch, and I’ve already fixed it and submitted a merge request.
MR:https://invent.kde.org/frameworks/kio/-/merge_requests/2006
Comment 3 Méven 2025-09-28 12:17:08 UTC
Git commit eb85a1ee051565a79b63b5b1dc65a8300d9080a6 by Méven Car, on behalf of Pan Zhang.
Committed on 28/09/2025 at 12:17.
Pushed by meven into branch 'master'.

trashimpl: Fix size limit check to allow automatic deletion

Previously adaptTrashSize() rejected new files whenever 'partitionSize + additionalSize' exceeded the limit, even if removing older/bigger files could make enough room. Now we only reject when the new file itself is larger than the maximum allowed trash size, so the cleanup policy (delete oldest / biggest) works as intended.

M  +4    -3    src/kioworkers/trash/trashimpl.cpp

https://invent.kde.org/frameworks/kio/-/commit/eb85a1ee051565a79b63b5b1dc65a8300d9080a6
Comment 4 Antti Savolainen 2025-11-07 06:10:53 UTC
The setting still does nothing.
Demonstrative video: https://youtu.be/MHMXGjJSh0A

As far as I understand it, this was supposed to be fixed in Frameworks 6.19

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.5.1
KDE Frameworks Version: 6.19.0
Qt Version: 6.10.0
Kernel Version: 6.17.7-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i7-7600U CPU @ 2.80GHz
Memory: 24 GiB of RAM (23.2 GiB usable)
Graphics Processor: Intel® HD Graphics 620
Manufacturer: LENOVO
Product Name: 20HG0003SG
System Version: ThinkPad T470s
Comment 5 Antti Savolainen 2026-08-03 05:28:06 UTC
The root issue seems to be that I have multiple drives. For some reason ktrashrc only contains settings for one of the external drives

$ cat ~/.config/ktrashrc
[/mnt/WD1TB/.Trash-1000]
Days=7
LimitReachedAction=0
Percent=2
UseSizeLimit=true
UseTimeLimit=false
Comment 7 Antti Savolainen 2026-08-05 00:10:15 UTC
Git commit be77f51bfb2ffc9a5bc6693f25c55e5b845bb5ed by Antti Savolainen.
Committed on 05/08/2026 at 00:01.
Pushed by asavolainen into branch 'master'.

kcmtrash.cpp: fix trash settings not detecting multiple mounts

M  +2    -2    kcms/trash/kcmtrash.cpp
M  +1    -1    kcms/trash/kcmtrash.h

https://invent.kde.org/network/kio-extras/-/commit/be77f51bfb2ffc9a5bc6693f25c55e5b845bb5ed
Comment 8 Méven 2026-08-09 07:24:58 UTC
Git commit 8344b3cc7c455c9cd98012b13e3506a52571d9bb by Méven Car.
Committed on 09/08/2026 at 07:16.
Pushed by meven into branch 'release/26.08'.

kcmtrash.cpp: fix trash settings not detecting multiple mounts


(cherry picked from commit be77f51bfb2ffc9a5bc6693f25c55e5b845bb5ed)

Co-authored-by: Antti Savolainen <antti.savo@gmail.com>

M  +2    -2    kcms/trash/kcmtrash.cpp
M  +1    -1    kcms/trash/kcmtrash.h

https://invent.kde.org/network/kio-extras/-/commit/8344b3cc7c455c9cd98012b13e3506a52571d9bb