Bug 504490 - After sending files to Trash, Dolphin selects files randomly
Summary: After sending files to Trash, Dolphin selects files randomly
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: view-engine: general (other bugs)
Version First Reported In: 25.04.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
: 505485 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-05-18 19:28 UTC by Patrick Silva
Modified: 2025-09-21 10:29 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
screen recording (435.39 KB, video/webm)
2025-05-18 19:28 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2025-05-18 19:28:21 UTC
Created attachment 181475 [details]
screen recording

SUMMARY
I can't reproduce this bug consistently, but it occurs often after the steps below.

STEPS TO REPRODUCE
1. open a folder containing several files
2. select some files randomly, with ctrl+click
3. send the selected files to Trash by pressing del key

OBSERVED RESULT
after sending the selected files to Trash, Dolphin unexpectedly selects other files randomly. Please watch the attached screen recording.

EXPECTED RESULT
no file should be selected after the provided steps

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.90
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Graphics Platform: Wayland
Comment 1 John Kizer 2025-05-22 05:27:21 UTC
I can reproduce on today's git master. Thanks!
Comment 2 John Kizer 2025-06-20 04:29:55 UTC
*** Bug 505485 has been marked as a duplicate of this bug. ***
Comment 3 Bug Janitor Service 2025-09-10 13:51:27 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/1051
Comment 4 Méven 2025-09-21 10:29:00 UTC
Git commit 76a79ba3e8660e9fdfd8e897c69065e79721545e by Méven Car.
Committed on 21/09/2025 at 08:40.
Pushed by meven into branch 'master'.

dolphinview: position the focus after the last removed file

Previously, the code could misposition the selection after removal if
the last file in the view was removed and several files were selected.

And since it didn't clear the selection, the previous selection
influence the selection.

Instead clear the selection and position only the focus, either on the
next item after the last index, or the last item still in the view if the last
item was removed.

M  +4    -8    src/views/dolphinview.cpp

https://invent.kde.org/system/dolphin/-/commit/76a79ba3e8660e9fdfd8e897c69065e79721545e