diff options
| author | Peter Penz <[email protected]> | 2007-10-05 22:32:13 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-10-05 22:32:13 +0000 |
| commit | 77a576335ca8ef6a8921b766c43b07b6eb65e80f (patch) | |
| tree | 87196284c274a8300c15cec9ad6a2308025fdbc3 /src/dolphindetailsview.cpp | |
| parent | 7a62507d3dea468b3f1709f1c37470eafa766303 (diff) | |
fixed most regressions due to the previous column-view refactoring
svn path=/trunk/KDE/kdebase/apps/; revision=721706
Diffstat (limited to 'src/dolphindetailsview.cpp')
| -rw-r--r-- | src/dolphindetailsview.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index 078f51bf1..6cd9fbaf9 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -84,10 +84,10 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr // RETURN-key in keyPressEvent(). if (KGlobalSettings::singleClick()) { connect(this, SIGNAL(clicked(const QModelIndex&)), - this, SLOT(slotItemActivated(const QModelIndex&))); + this, SLOT(triggerItem(const QModelIndex&))); } else { connect(this, SIGNAL(doubleClicked(const QModelIndex&)), - this, SLOT(slotItemActivated(const QModelIndex&))); + this, SLOT(triggerItem(const QModelIndex&))); } connect(this, SIGNAL(entered(const QModelIndex&)), this, SLOT(slotEntered(const QModelIndex&))); @@ -317,11 +317,11 @@ void DolphinDetailsView::keyPressEvent(QKeyEvent* event) 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); + const bool trigger = currentIndex.isValid() + && (event->key() == Qt::Key_Return) + && (selModel->selectedIndexes().count() <= 1); + if (trigger) { + triggerItem(currentIndex); } } @@ -434,13 +434,14 @@ void DolphinDetailsView::zoomOut() } } -void DolphinDetailsView::slotItemActivated(const QModelIndex& index) +void DolphinDetailsView::triggerItem(const QModelIndex& index) { + const KFileItem item = itemForIndex(index); if (index.isValid() && (index.column() == KDirModel::Name)) { - m_controller->triggerItem(index); + m_controller->triggerItem(item); } else { clearSelection(); - m_controller->emitItemEntered(itemForIndex(index)); + m_controller->emitItemEntered(item); } } |
