diff options
| author | David Faure <[email protected]> | 2007-08-28 17:50:54 +0000 |
|---|---|---|
| committer | David Faure <[email protected]> | 2007-08-28 17:50:54 +0000 |
| commit | 9c7ccd477a32ad52ff0126024ffbad0f6ea164b5 (patch) | |
| tree | de563ec1aa33aeb42ac46ed5e4fde2f5aac02c3a /src/dolphindetailsview.cpp | |
| parent | 9442ea96f5e96be9f3a4895c243579d46d2152c5 (diff) | |
Clicking on items in dolphin part finally implemented.
Fixed connect() error in dolphinstatusbar [unrelated].
svn path=/trunk/KDE/kdebase/apps/; revision=705835
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" |
