diff options
Diffstat (limited to 'src/dolphiniconsview.cpp')
| -rw-r--r-- | src/dolphiniconsview.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp index ed2332c05..d287318d0 100644 --- a/src/dolphiniconsview.cpp +++ b/src/dolphiniconsview.cpp @@ -209,8 +209,14 @@ void DolphinIconsView::paintEvent(QPaintEvent* event) void DolphinIconsView::keyPressEvent(QKeyEvent* event) { KCategorizedView::keyPressEvent(event); - if (event->key() == Qt::Key_Return) { - m_controller->triggerItem(selectionModel()->currentIndex()); + + const QItemSelectionModel* selModel = selectionModel(); + const QModelIndex currentIndex = selModel->currentIndex(); + const bool triggerItem = currentIndex.isValid() + && (event->key() == Qt::Key_Return) + && (selModel->selectedIndexes().count() <= 1); + if (triggerItem) { + m_controller->triggerItem(currentIndex); } } |
