┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemlistcontroller.cpp
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2012-04-25 09:17:30 +0200
committerFrank Reininghaus <[email protected]>2012-04-25 09:17:43 +0200
commit90baf5a8977caf5cbc1cd9c161c56e97e02a1aef (patch)
treea4aacb24b2eeadd8554388985aa52768128268b1 /src/kitemviews/kitemlistcontroller.cpp
parentfa447df6428ae0182073a681a33b78d2ac9343a5 (diff)
When Esc is pressed, clear the selection and cancel the keyboard search
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)
Diffstat (limited to 'src/kitemviews/kitemlistcontroller.cpp')
-rw-r--r--src/kitemviews/kitemlistcontroller.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp
index 011a3b57d..1f93a6357 100644
--- a/src/kitemviews/kitemlistcontroller.cpp
+++ b/src/kitemviews/kitemlistcontroller.cpp
@@ -374,6 +374,13 @@ bool KItemListController::keyPressEvent(QKeyEvent* event)
break;
}
+ case Qt::Key_Escape:
+ if (m_selectionBehavior != SingleSelection) {
+ m_selectionManager->clearSelection();
+ }
+ m_keyboardManager->cancelSearch();
+ break;
+
default:
m_keyboardManager->addKeys(event->text());
return false;