X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/29402a79bc09945ccd96201cbb42027b4c581a00..b5eca6dc2aaa6f90d7dc2fe27ab9ccc45aee77f2:/src/dolphindetailsview.cpp diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index 078f51bf1..8e8eec2ec 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&))); @@ -193,7 +193,7 @@ void DolphinDetailsView::contextMenuEvent(QContextMenuEvent* event) void DolphinDetailsView::mousePressEvent(QMouseEvent* event) { - m_controller->triggerActivation(); + m_controller->requestActivation(); QTreeView::mousePressEvent(event); @@ -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); } }