]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp
Port from KIconLoader::drawOverlays to KIconUtils::addOverlays
[dolphin.git] / src / kitemviews / private / kitemlistkeyboardsearchmanager.cpp
index b7318b34406eeb0f1f42101fa273a8c1f1465b56..c18f87b7d280e872b4accae4b6dd4f3d78d32540 100644 (file)
@@ -27,6 +27,11 @@ bool KItemListKeyboardSearchManager::shouldClearSearchIfInputTimeReached()
     return (keyboardInputTimeElapsed > m_timeout) || !keyboardTimeWasValid;
 }
 
+bool KItemListKeyboardSearchManager::isSearchAsYouTypeActive() const
+{
+    return !m_searchedString.isEmpty() && !m_keyboardInputTime.hasExpired(m_timeout);
+}
+
 void KItemListKeyboardSearchManager::addKeys(const QString &keys)
 {
     if (shouldClearSearchIfInputTimeReached()) {
@@ -63,11 +68,6 @@ void KItemListKeyboardSearchManager::addKeys(const QString &keys)
     m_keyboardInputTime.start();
 }
 
-bool KItemListKeyboardSearchManager::addKeyBeginsNewSearch() const
-{
-    return m_keyboardInputTime.hasExpired(m_timeout) || m_searchedString.isEmpty();
-}
-
 void KItemListKeyboardSearchManager::setTimeout(qint64 milliseconds)
 {
     m_timeout = milliseconds;
@@ -101,3 +101,5 @@ void KItemListKeyboardSearchManager::slotSelectionChanged(const KItemSet &curren
         cancelSearch();
     }
 }
+
+#include "moc_kitemlistkeyboardsearchmanager.cpp"