Bug 461847

Summary: dolphin slow to move files to trash - delay of a few seconds before file is moved, regardless of file size
Product: [Applications] dolphin Reporter: jabzwnein
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: kfm-devel, meven29, nate, php4fan, serg, s_chriscollins
Priority: NOR    
Version First Reported In: 22.08.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description jabzwnein 2022-11-15 01:02:08 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. delete file in Dolphin

OBSERVED RESULT

1. It takes 3-10 seconds to move any file in Dolphin, regardless of file size and regardless of the trash settings (e.g. whether or not any limit on trash folder size is in place). 

EXPECTED RESULT

1. File should be immediately moved to the trash folder.

SOFTWARE/OS VERSIONS

Operating System: EndeavourOS
KDE Plasma Version: 5.26.3
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.7
Kernel Version: 6.0.7-arch1-1 (64-bit)
Graphics Platform: X11
Comment 1 S. Christian Collins 2023-01-10 04:22:16 UTC
I have noticed that moving files to trash takes longer and longer over time as the trash collects files. After emptying the trash, file deletion is faster until enough files have been deleted and it gets slower again.
Comment 2 Méven Car 2023-09-05 10:44:49 UTC
Just to clarify a bit:
Are the files you are putting to trash have the same names as files already in the trash ?

How many files do you have in the trash ?

I have a MR that will help the situation https://invent.kde.org/frameworks/kio/-/merge_requests/1398
With it moving files to trash will be twice as fast when they are many files in the trash already.

But still not close to instantaneous as one would expect, so it won't fix the bug, unless the patch improves things sufficiently in your opinions (jabzwnein@gmail.com and S. Christian Collins).
Comment 3 Méven Car 2023-09-09 12:43:51 UTC
Git commit 0ab81b6bac953b12b454bef4874946bb7fc8db85 by Méven Car, on behalf of Méven Car.
Committed on 09/09/2023 at 11:51.
Pushed by meven into branch 'master'.

trashimpl: optimize TrashSizeCache::calculateSize

Make TrashSizeCache::calculateSize not check modification dates.

This divides by two the number of stats run for each file already in the trash each time a file is moved into the trash.

M  +25   -15   src/kioworkers/trash/trashsizecache.cpp
M  +3    -1    src/kioworkers/trash/trashsizecache.h

https://invent.kde.org/frameworks/kio/-/commit/0ab81b6bac953b12b454bef4874946bb7fc8db85
Comment 4 Bug Janitor Service 2023-09-12 15:32:32 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1410
Comment 5 Méven Car 2023-09-14 15:21:51 UTC
Git commit b6a809b2cf6511ff850bfed453f75d3c5fd5d297 by Méven Car, on behalf of Méven Car.
Committed on 14/09/2023 at 17:21.
Pushed by meven into branch 'kf5'.

trashimpl: optimize TrashSizeCache::calculateSize

Make TrashSizeCache::calculateSize not check modification dates.

This divides by two the number of stats run for each file already in the trash each time a file is moved into the trash.
(cherry picked from commit 0ab81b6bac953b12b454bef4874946bb7fc8db85)

M  +25   -15   src/ioslaves/trash/trashsizecache.cpp
M  +3    -1    src/ioslaves/trash/trashsizecache.h

https://invent.kde.org/frameworks/kio/-/commit/b6a809b2cf6511ff850bfed453f75d3c5fd5d297
Comment 6 John Kizer 2025-05-27 17:22:39 UTC
*** Bug 504707 has been marked as a duplicate of this bug. ***