┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews
diff options
context:
space:
mode:
authorNate Graham <[email protected]>2025-11-11 10:47:26 -0700
committerNate Graham <[email protected]>2025-11-12 07:54:30 -0700
commit7419cd326902c64b69802ab3f01656076d3c7a97 (patch)
treedf2d639be758b5333730c8663e7e7de14fdd6f9b /src/kitemviews
parent0a3c5ab0a7e232b457b43d97759d36a2315c37cd (diff)
Revert "Avoid implicitly selecting items"
This reverts commit 122fee5625f0285ec4ebda79162c72390989eb2a. This behavior change was well-intentioned, but has significant usability and speed drawbacks that have not been addressed: - Keyboard-driven folder manipulation became slower - Unexpected behavioral differences when opening files with the pointer compared to when opening them with the keyboard introduced inconsistency and cognitive load - Unexpected opening of selection mode during fast operation introduced the potential for confusion and additional errors - Dolphin's behavior became inconsistent with that of other file managers users may be accustomed to The bug tracker, discuss.kde.org, and Reddit are full of complaints about this change. It's been a year now; I think it's clear that many Dolphin users have not gotten used to and accepted it. I have to count myself as one of them, I'm afraid. I've tried to get used to it for a year, but I just have not been able to. I don't believe the benefits of this change outweigh the drawbacks, so let's revert it. 24d859cf19e90fa22ed687b36a68231625c1bd80 was explicitly mentioned as a thing that should also be reverted in this case, but it's already been done. BUG: 494125 BUG: 511966 CCBUG: 424723 CCBUG: 492404 FIXED-IN: 25.12.0
Diffstat (limited to 'src/kitemviews')
-rw-r--r--src/kitemviews/kitemlistcontroller.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp
index 7971de5b7..d889deb4e 100644
--- a/src/kitemviews/kitemlistcontroller.cpp
+++ b/src/kitemviews/kitemlistcontroller.cpp
@@ -732,9 +732,6 @@ bool KItemListController::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event,
const bool emitItemActivated = index.has_value() && index.value() < m_model->count() && !m_view->isAboveExpansionToggle(index.value(), pos);
if (emitItemActivated) {
- if (!QApplication::keyboardModifiers()) {
- m_selectionManager->clearSelection(); // The user does not want to manage/manipulate the item currently, only activate it.
- }
Q_EMIT itemActivated(index.value());
}
return false;
@@ -1674,14 +1671,10 @@ bool KItemListController::onPress(const QPointF &pos, const Qt::KeyboardModifier
// or we just keep going for double-click activation
if (singleClickActivation || m_singleClickActivationEnforced) {
if (!pressedItemAlreadySelected) {
- // An unselected item was clicked directly while deselecting multiple other items so we mark it "current".
+ // An unselected item was clicked directly while deselecting multiple other items so we select it.
+ m_selectionManager->setSelected(m_pressedIndex.value(), 1, KItemListSelectionManager::Toggle);
m_selectionManager->setCurrentItem(m_pressedIndex.value());
m_selectionManager->beginAnchoredSelection(m_pressedIndex.value());
- if (!leftClick) {
- // We select the item here because this press is not meant to directly activate the item.
- // We do not want to select items unless the user wants to edit them.
- m_selectionManager->setSelected(m_pressedIndex.value(), 1, KItemListSelectionManager::Toggle);
- }
}
if (leftClick) {
row->setPressed(true);
@@ -1756,10 +1749,7 @@ bool KItemListController::onPress(const QPointF &pos, const Qt::KeyboardModifier
break;
case SingleSelection:
- if (!leftClick || shiftOrControlPressed || (!singleClickActivation && !m_singleClickActivationEnforced)) {
- m_selectionManager->setSelected(m_pressedIndex.value());
- }
- break;
+ m_selectionManager->setSelected(m_pressedIndex.value());
case MultiSelection:
if (controlPressed && !shiftPressed && leftClick) {
@@ -1778,10 +1768,7 @@ bool KItemListController::onPress(const QPointF &pos, const Qt::KeyboardModifier
// This will be the start of an item drag-to-copy operation if the user now moves the mouse before releasing the mouse button.
}
} else if (!shiftPressed || !m_selectionManager->isAnchoredSelectionActive()) {
- // Select the pressed item and start a new anchored selection
- if (!leftClick || shiftOrControlPressed || (!singleClickActivation && !m_singleClickActivationEnforced)) {
- m_selectionManager->setSelected(m_pressedIndex.value(), 1, KItemListSelectionManager::Select);
- }
+ m_selectionManager->setSelected(m_pressedIndex.value(), 1, KItemListSelectionManager::Select);
m_selectionManager->beginAnchoredSelection(m_pressedIndex.value());
}
break;