This patch restores the Dolphin 1.x behaviour that Esc clears the
selection (Dolphin 2.0 did not have an easy way to clear the selection
using the keyboard so far). Moreover, Esc now also cancels the current
keyboard search. This fixes the problem that the only way to cancel the
search is to wait until the timeout has expired.
CCBUG: 298742
CCBUG: 297458
(cherry picked from commit
d3b1312d3edc615b03fb17c1a5fa62ccb61cdabd)
+ case Qt::Key_Escape:
+ if (m_selectionBehavior != SingleSelection) {
+ m_selectionManager->clearSelection();
+ }
+ m_keyboardManager->cancelSearch();
+ break;
+
default:
m_keyboardManager->addKeys(event->text());
return false;
default:
m_keyboardManager->addKeys(event->text());
return false;
#include <QApplication>
#include <QElapsedTimer>
#include <QApplication>
#include <QElapsedTimer>
KItemListKeyboardSearchManager::KItemListKeyboardSearchManager(QObject* parent) :
QObject(parent),
m_timeout(1000)
KItemListKeyboardSearchManager::KItemListKeyboardSearchManager(QObject* parent) :
QObject(parent),
m_timeout(1000)
+void KItemListKeyboardSearchManager::cancelSearch()
+{
+ m_searchedString.clear();
+}
void setTimeout(qint64 milliseconds);
qint64 timeout() const;
void setTimeout(qint64 milliseconds);
qint64 timeout() const;
signals:
/**
* Is emitted if the current item should be changed corresponding
signals:
/**
* Is emitted if the current item should be changed corresponding