]> cloud.milkyroute.net Git - dolphin.git/commit
Avoid implicitly selecting items
authorFelix Ernst <felixernst@kde.org>
Sat, 18 May 2024 22:18:14 +0000 (22:18 +0000)
committerFelix Ernst <felixernst@kde.org>
Sat, 18 May 2024 22:18:14 +0000 (22:18 +0000)
commit122fee5625f0285ec4ebda79162c72390989eb2a
tree151d7137aa4775de1c37509a751daeca492ff10f
parentdfac2e02c1fde267449a0738b7b96369e8bc0db3
Avoid implicitly selecting items

Items should only be selected if the user wants to act on them.
However, previous to this commit we sometimes selected items even
when there is no reason to assume that the user would like to act
on them. Such selections are dangerous because they make it more
likely that the user manipulates items by accident which they
never even explicitly selected.

Example: The "Up" action is used to navigate to the parent folder.
This will implicitly select the folder one emerged from after
opening the parent folder, so just one accidental press of the
Delete key will lead to data loss if the press goes unnoticed. This
scenario would have been avoided if no folder had been selected
automatically.

The above example becomes even more dangerous if the user is acting
with elevated privileges.

The following implicit selections of items are being removed:
- Selecting items that are being activated
- Selecting folders one emerges from

Even though these items will no longer be selected after these
actions, they will still be marked as current.

The only downside I see is that our indication of which item is "current" is a lot weaker than the selection highlight, so it might be more difficult to spot which folder one has emerged from. However, this could be counter-acted with some other temporary indication if this really turns out to be a problem.

The only downside I see is that our indication of which item is
"current" is a lot weaker than the selection highlight, so it might be
more difficult to spot which folder one has emerged from. However, this
could be counter-acted with some other temporary indication if this
really turns out to be a problem.

BUG: 424723
src/dolphinviewcontainer.cpp
src/kitemviews/kitemlistcontroller.cpp
src/tests/dolphinmainwindowtest.cpp
src/tests/kitemlistcontrollertest.cpp