diff options
Diffstat (limited to 'src/dolphindetailsview.cpp')
| -rw-r--r-- | src/dolphindetailsview.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index ef3146c20..1aec30cca 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -71,10 +71,10 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr if (KGlobalSettings::singleClick()) { connect(this, SIGNAL(clicked(const QModelIndex&)), - controller, SLOT(triggerItem(const QModelIndex&))); + this, SLOT(slotItemActivated(const QModelIndex&))); } else { connect(this, SIGNAL(doubleClicked(const QModelIndex&)), - controller, SLOT(triggerItem(const QModelIndex&))); + this, SLOT(slotItemActivated(const QModelIndex&))); } connect(this, SIGNAL(entered(const QModelIndex&)), this, SLOT(slotEntered(const QModelIndex&))); @@ -391,4 +391,19 @@ QRect DolphinDetailsView::elasticBandRect() const return QRect(topLeft, m_elasticBandDestination).normalized(); } +static bool isValidNameIndex(const QModelIndex& index) +{ + return index.isValid() && (index.column() == KDirModel::Name); +} + +void DolphinDetailsView::slotItemActivated(const QModelIndex& index) +{ + if (!isValidNameIndex(index)) { + clearSelection(); + m_controller->emitItemEntered(index); + } else { + m_controller->triggerItem(index); + } +} + #include "dolphindetailsview.moc" |
