diff options
| author | Yifan Zhu <[email protected]> | 2025-02-20 10:35:06 -0800 |
|---|---|---|
| committer | Yifan Zhu <[email protected]> | 2025-02-22 14:26:57 -0800 |
| commit | b4dedc0d0df2c8b191192476d7787630180e51c7 (patch) | |
| tree | 095c84eee1c8e484b8d1ea1a568790c1aa6704fa /src/tests/kitemlistkeyboardsearchmanagertest.cpp | |
| parent | 79d1f25ad14b1626c64d7f25c2fa16da0e2b2737 (diff) | |
kitemlistkeyboardsearchmanager: smarter search start position
Search from the next position for new search and special repeated key search.
Otherwise search from the current position, which is current selected item if
something is selected or in selection mode, and 0 (the beginning) otherwise.
Test plan:
- create directory with files ab1, ab2, and ab3
- click ab2, and press escape to deselect
- type ab; verify that ab1 is selected
- wait a while, type ab again, verify that ab2 is selected
- wait a while, type ab again, verify that ab3 is selected
- click ab1, type ab, verify that ab2 is selected
BUG: 422951
Diffstat (limited to 'src/tests/kitemlistkeyboardsearchmanagertest.cpp')
| -rw-r--r-- | src/tests/kitemlistkeyboardsearchmanagertest.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tests/kitemlistkeyboardsearchmanagertest.cpp b/src/tests/kitemlistkeyboardsearchmanagertest.cpp index 17424c801..bbdb9c397 100644 --- a/src/tests/kitemlistkeyboardsearchmanagertest.cpp +++ b/src/tests/kitemlistkeyboardsearchmanagertest.cpp @@ -45,7 +45,7 @@ void KItemListKeyboardSearchManagerTest::testBasicKeyboardSearch() m_keyboardSearchManager.addKeys("f"); QCOMPARE(spy.count(), 1); - QCOMPARE(spy.takeFirst(), QList<QVariant>() << "f" << false); + QCOMPARE(spy.takeFirst(), QList<QVariant>() << "f" << true); m_keyboardSearchManager.addKeys("i"); QCOMPARE(spy.count(), 1); @@ -71,7 +71,7 @@ void KItemListKeyboardSearchManagerTest::testAbortedKeyboardSearch() m_keyboardSearchManager.addKeys("f"); QCOMPARE(spy.count(), 1); - QCOMPARE(spy.takeFirst(), QList<QVariant>() << "f" << false); + QCOMPARE(spy.takeFirst(), QList<QVariant>() << "f" << true); m_keyboardSearchManager.addKeys("i"); QCOMPARE(spy.count(), 1); @@ -94,7 +94,7 @@ void KItemListKeyboardSearchManagerTest::testAbortedKeyboardSearch() m_keyboardSearchManager.addKeys("a"); QCOMPARE(spy.count(), 1); - QCOMPARE(spy.takeFirst(), QList<QVariant>() << "a" << false); + QCOMPARE(spy.takeFirst(), QList<QVariant>() << "a" << true); } void KItemListKeyboardSearchManagerTest::testRepeatedKeyPress() @@ -110,7 +110,7 @@ void KItemListKeyboardSearchManagerTest::testRepeatedKeyPress() m_keyboardSearchManager.addKeys("p"); QCOMPARE(spy.count(), 1); - QCOMPARE(spy.takeFirst(), QList<QVariant>() << "p" << false); + QCOMPARE(spy.takeFirst(), QList<QVariant>() << "p" << true); m_keyboardSearchManager.addKeys("p"); QCOMPARE(spy.count(), 1); @@ -139,7 +139,7 @@ void KItemListKeyboardSearchManagerTest::testPressShift() // Simulate that the user enters "a_b". m_keyboardSearchManager.addKeys("a"); QCOMPARE(spy.count(), 1); - QCOMPARE(spy.takeFirst(), QList<QVariant>() << "a" << false); + QCOMPARE(spy.takeFirst(), QList<QVariant>() << "a" << true); m_keyboardSearchManager.addKeys(""); QCOMPARE(spy.count(), 0); |
