┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/tests
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/tests
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/tests')
-rw-r--r--src/tests/dolphinmainwindowtest.cpp2
-rw-r--r--src/tests/kitemlistcontrollertest.cpp8
2 files changed, 1 insertions, 9 deletions
diff --git a/src/tests/dolphinmainwindowtest.cpp b/src/tests/dolphinmainwindowtest.cpp
index d309b6d9c..fb3c95383 100644
--- a/src/tests/dolphinmainwindowtest.cpp
+++ b/src/tests/dolphinmainwindowtest.cpp
@@ -672,7 +672,7 @@ void DolphinMainWindowTest::testGoActions()
};
QCOMPARE(currentItemUrl(), childDirUrl); // The item we just emerged from should now have keyboard focus.
- QCOMPARE(m_mainWindow->m_activeViewContainer->view()->selectedItems().count(), 0); // The item we just emerged from should not be selected. BUG: 424723
+ QCOMPARE(m_mainWindow->m_activeViewContainer->view()->selectedItems().count(), 1); // …and it should be selected, too.
// Pressing arrow keys should not only move the keyboard focus but also select the item.
// We press "Down" to select "c" below and then "Up" so the folder "b" we just emerged from is selected for the first time.
m_mainWindow->actionCollection()->action(QStringLiteral("compact"))->trigger();
diff --git a/src/tests/kitemlistcontrollertest.cpp b/src/tests/kitemlistcontrollertest.cpp
index e9e1e66c2..8fd0f6158 100644
--- a/src/tests/kitemlistcontrollertest.cpp
+++ b/src/tests/kitemlistcontrollertest.cpp
@@ -1088,7 +1088,6 @@ void KItemListControllerTest::testMouseClickActivation()
m_view->event(&mouseReleaseEvent);
QCOMPARE(spyItemActivated.count(), 1);
spyItemActivated.clear();
- QVERIFY2(!m_view->controller()->selectionManager()->hasSelection(), "An item should not be implicitly selected during activation. @see bug 424723");
// Set the global setting to "double click activation".
m_testStyle->setActivateItemOnSingleClick(false);
@@ -1096,7 +1095,6 @@ void KItemListControllerTest::testMouseClickActivation()
m_view->event(&mouseReleaseEvent);
QCOMPARE(spyItemActivated.count(), 0);
spyItemActivated.clear();
- QVERIFY(m_view->controller()->selectionManager()->hasSelection());
// emulation of double click according to https://doc.qt.io/qt-6/qgraphicsscene.html#mouseDoubleClickEvent
m_view->event(&mousePressEvent);
@@ -1105,7 +1103,6 @@ void KItemListControllerTest::testMouseClickActivation()
m_view->event(&mouseReleaseEvent);
QCOMPARE(spyItemActivated.count(), 1);
spyItemActivated.clear();
- QVERIFY2(!m_view->controller()->selectionManager()->hasSelection(), "An item should not be implicitly selected during activation. @see bug 424723");
// right mouse button should not trigger activation
m_view->event(&mouseRightPressEvent);
@@ -1127,8 +1124,6 @@ void KItemListControllerTest::testMouseClickActivation()
m_view->event(&mouseReleaseEvent);
QCOMPARE(spyItemActivated.count(), 1);
spyItemActivated.clear();
- constexpr const char *reasonWhySelectionShouldPersist = "An item was selected before this mouse click. The click should not have cleared this selection.";
- QVERIFY2(m_view->controller()->selectionManager()->hasSelection(), reasonWhySelectionShouldPersist);
// Do not enforce single click activation in the controller.
m_controller->setSingleClickActivationEnforced(false);
@@ -1136,7 +1131,6 @@ void KItemListControllerTest::testMouseClickActivation()
m_view->event(&mouseReleaseEvent);
QCOMPARE(spyItemActivated.count(), 0);
spyItemActivated.clear();
- QVERIFY2(m_view->controller()->selectionManager()->hasSelection(), reasonWhySelectionShouldPersist);
// Set the global setting back to "single click activation".
m_testStyle->setActivateItemOnSingleClick(true);
@@ -1144,7 +1138,6 @@ void KItemListControllerTest::testMouseClickActivation()
m_view->event(&mouseReleaseEvent);
QCOMPARE(spyItemActivated.count(), 1);
spyItemActivated.clear();
- QVERIFY2(m_view->controller()->selectionManager()->hasSelection(), reasonWhySelectionShouldPersist);
// Enforce single click activation in the controller.
m_controller->setSingleClickActivationEnforced(true);
@@ -1152,7 +1145,6 @@ void KItemListControllerTest::testMouseClickActivation()
m_view->event(&mouseReleaseEvent);
QCOMPARE(spyItemActivated.count(), 1);
spyItemActivated.clear();
- QVERIFY2(m_view->controller()->selectionManager()->hasSelection(), reasonWhySelectionShouldPersist);
// Restore previous settings.
m_controller->setSingleClickActivationEnforced(true);