┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHarsh Chouraria J <[email protected]>2010-01-11 12:08:38 +0000
committerHarsh Chouraria J <[email protected]>2010-01-11 12:08:38 +0000
commitc8ad5fd5b615f7d1a5ed1e793bfc367f7d3966b3 (patch)
treee3eb5ebd006ff472bcafb74995027b4afd16632a /src
parentaf3bf0958af68ae74045268039b6d3ed7ecc6513 (diff)
BUG:222186
With respect to the action done on hitting the "Return/Enter" key: * Fix the behavior for multiple-item opening, when they have directories among them. * Open multiple directories in background tabs. svn path=/trunk/KDE/kdebase/apps/; revision=1073019
Diffstat (limited to 'src')
-rw-r--r--src/dolphincontroller.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/dolphincontroller.cpp b/src/dolphincontroller.cpp
index 408abd501..0bbf0557a 100644
--- a/src/dolphincontroller.cpp
+++ b/src/dolphincontroller.cpp
@@ -175,9 +175,28 @@ void DolphinController::handleKeyPressEvent(QKeyEvent* event)
|| (event->key() == Qt::Key_Enter))
&& !selModel->selectedIndexes().isEmpty();
if (trigger) {
+ QModelIndexList dirQueue;
const QModelIndexList indexList = selModel->selectedIndexes();
foreach (const QModelIndex& index, indexList) {
- emit itemTriggered(itemForIndex(index));
+ // Trigger non-directories immediately.
+ if (!itemForIndex(index).isDir()) {
+ emit itemTriggered(itemForIndex(index));
+ } else {
+ // Keep storing the directory indexes for trigger later.
+ dirQueue << index;
+ }
+ }
+ // Trigger directories - Tabs if multiple, else normal.
+ if (!dirQueue.isEmpty()) {
+ if (dirQueue.length() == 1) {
+ // For single directory selection, open normally.
+ emit itemTriggered(itemForIndex(dirQueue[0]));
+ } else {
+ foreach(const QModelIndex& dir, dirQueue) {
+ // Since its a valid directory - open a tab.
+ emit tabRequested(itemForIndex(dir).url());
+ }
+ }
}
}
}