summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Reininghaus <frank78ac@googlemail.com>2012-03-28 17:15:20 (GMT)
committerFrank Reininghaus <frank78ac@googlemail.com>2012-03-28 17:18:46 (GMT)
commit02eab49b2de51c31fe46a0d9501327b579b3648e (patch)
tree45cae4c15b6788f15fc726f13ed9a843c9a71862
parent210e5e3b96883f5d856913f81834310ecb3819bf (diff)
Increase the timeout in KItemListKeyboardSearchManager to 5 seconds
The previous timeout [QApplication::keyboardInputInterval()] was too short to do a multi-letter search for users who do not type extremely fast. FIXED-IN: 4.8.2
-rw-r--r--dolphin/src/kitemviews/kitemlistkeyboardsearchmanager.cpp4
-rw-r--r--dolphin/src/tests/kitemlistkeyboardsearchmanagertest.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/dolphin/src/kitemviews/kitemlistkeyboardsearchmanager.cpp b/dolphin/src/kitemviews/kitemlistkeyboardsearchmanager.cpp
index cefedfc..1ff60d0 100644
--- a/dolphin/src/kitemviews/kitemlistkeyboardsearchmanager.cpp
+++ b/dolphin/src/kitemviews/kitemlistkeyboardsearchmanager.cpp
@@ -41,8 +41,8 @@ void KItemListKeyboardSearchManager::addKeys(const QString& keys)
{
const bool keyboardTimeWasValid = m_keyboardInputTime.isValid();
const qint64 keyboardInputTimeElapsed = m_keyboardInputTime.restart();
- if (keyboardInputTimeElapsed > QApplication::keyboardInputInterval()
- || !keyboardTimeWasValid || keys.isEmpty()) {
+ const qint64 timeout = 5000;
+ if (keyboardInputTimeElapsed > timeout || !keyboardTimeWasValid || keys.isEmpty()) {
m_searchedString.clear();
}
diff --git a/dolphin/src/tests/kitemlistkeyboardsearchmanagertest.cpp b/dolphin/src/tests/kitemlistkeyboardsearchmanagertest.cpp
index be48393..14a09a3 100644
--- a/dolphin/src/tests/kitemlistkeyboardsearchmanagertest.cpp
+++ b/dolphin/src/tests/kitemlistkeyboardsearchmanagertest.cpp
@@ -75,9 +75,9 @@ void KItemListKeyboardSearchManagerTest::testAbortedKeyboardSearch()
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.takeFirst(), QList<QVariant>() << "fi" << false);
- // If the delay between two key presses is larger than QApplication::keyboardInputInterval(),
+ // If the delay between two key presses is larger than 5000 milliseconds,
// a new search is started. We add a small safety margin to avoid race conditions.
- QTest::qWait(QApplication::keyboardInputInterval() + 10);
+ QTest::qWait(5000 + 10);
m_keyboardSearchManager.addKeys("l");
QCOMPARE(spy.count(), 1);