// 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&)));
void DolphinDetailsView::mousePressEvent(QMouseEvent* event)
{
- m_controller->triggerActivation();
+ m_controller->requestActivation();
QTreeView::mousePressEvent(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);
}
}
}
}
-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);
}
}