┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphindetailsview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-09-09 18:54:32 +0000
committerPeter Penz <[email protected]>2007-09-09 18:54:32 +0000
commitea270709c1ed77978d0b88016ab490fe67b73c56 (patch)
tree48639f5227019004a9b5c56d83ff6698eadaa541 /src/dolphindetailsview.cpp
parenta69d7a39557527794fa871fba3f2909b662c3935 (diff)
check whether the current index is valid and whether no other items are selected
svn path=/trunk/KDE/kdebase/apps/; revision=710361
Diffstat (limited to 'src/dolphindetailsview.cpp')
-rw-r--r--src/dolphindetailsview.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp
index dfd7018bb..d7c8c5ab1 100644
--- a/src/dolphindetailsview.cpp
+++ b/src/dolphindetailsview.cpp
@@ -278,8 +278,14 @@ void DolphinDetailsView::paintEvent(QPaintEvent* event)
void DolphinDetailsView::keyPressEvent(QKeyEvent* event)
{
QTreeView::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);
}
}