diff options
| author | David Faure <[email protected]> | 2010-04-26 15:50:59 +0000 |
|---|---|---|
| committer | David Faure <[email protected]> | 2010-04-26 15:50:59 +0000 |
| commit | dc0236254abc9f11210e101a3089b8d9afff262b (patch) | |
| tree | a7e8e78bc4f22f7c0fdd37c8d6fcf5efc2250844 /src/dolphinviewcontroller.cpp | |
| parent | a1063f616b54033b314b4d6b4670dc907667c08e (diff) | |
use KFileItemActions::runPreferredApplications to handle Key_Enter on multiple selected files.
Rewritten to make a direct method call rather than using a signal from 'this'.
REVIEW: 3163
CCMAIL: [email protected]
svn path=/trunk/KDE/kdebase/apps/; revision=1119117
Diffstat (limited to 'src/dolphinviewcontroller.cpp')
| -rw-r--r-- | src/dolphinviewcontroller.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/dolphinviewcontroller.cpp b/src/dolphinviewcontroller.cpp index 4ce83f968..6ef32f07f 100644 --- a/src/dolphinviewcontroller.cpp +++ b/src/dolphinviewcontroller.cpp @@ -21,6 +21,7 @@ #include "zoomlevelinfo.h" #include <kdirmodel.h> +#include <kfileitemactions.h> #include <QAbstractProxyModel> #include <QApplication> #include <QClipboard> @@ -138,19 +139,24 @@ void DolphinViewController::handleKeyPressEvent(QKeyEvent* event) return; } - // Emit the signal itemTriggered() for all selected files. + // Collect the non-directory files into a list and + // call runPreferredApplications for that list. // Several selected directories are opened in separate tabs, // one selected directory will get opened in the view. QModelIndexList dirQueue; const QModelIndexList indexList = selModel->selectedIndexes(); + KFileItemList fileOpenList; foreach (const QModelIndex& index, indexList) { if (itemForIndex(index).isDir()) { dirQueue << index; } else { - emit itemTriggered(itemForIndex(index)); + fileOpenList << itemForIndex(index); } } + KFileItemActions fileItemActions; + fileItemActions.runPreferredApplications(fileOpenList, "DesktopEntryName != 'dolphin'"); + if (dirQueue.length() == 1) { // open directory in the view emit itemTriggered(itemForIndex(dirQueue[0])); |
