From: Peter Penz Date: Sat, 11 Jul 2009 18:56:03 +0000 (+0000) Subject: Don't open folders on a single-click in the column view when the mouse settings speci... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/430c2e768c58399bc998df8cd3f499f1bd48b9ea Don't open folders on a single-click in the column view when the mouse settings specify double-click. Originally this was meant as a kind of feature (open files on double-click, but folders still on single-click), but it has been received as bug. BUG: 198464 svn path=/trunk/KDE/kdebase/apps/; revision=995029 --- diff --git a/src/dolphincolumnwidget.cpp b/src/dolphincolumnwidget.cpp index c8bff0290..b4c9f11c1 100644 --- a/src/dolphincolumnwidget.cpp +++ b/src/dolphincolumnwidget.cpp @@ -500,28 +500,6 @@ void DolphinColumnWidget::slotEntered(const QModelIndex& index) m_view->m_controller->emitItemEntered(index); } -void DolphinColumnWidget::slotClicked(const QModelIndex& index) -{ - DolphinController* controller = m_view->m_controller; - if (KGlobalSettings::singleClick()) { - controller->triggerItem(index); - } else { - // even when using double click, a directory should be opened - // after the first click - const KFileItem item = controller->itemForIndex(index); - if (!item.isNull() && item.isDir()) { - controller->triggerItem(index); - } - } -} - -void DolphinColumnWidget::slotDoubleClicked(const QModelIndex& index) -{ - if (!KGlobalSettings::singleClick()) { - m_view->m_controller->triggerItem(index); - } -} - void DolphinColumnWidget::requestActivation() { m_view->m_controller->setItemView(this); @@ -547,12 +525,13 @@ void DolphinColumnWidget::activate() { setFocus(Qt::OtherFocusReason); - connect(this, SIGNAL(clicked(const QModelIndex&)), - m_view->m_controller, SLOT(requestTab(const QModelIndex&))); - connect(this, SIGNAL(clicked(const QModelIndex&)), - this, SLOT(slotClicked(const QModelIndex&))); - connect(this, SIGNAL(doubleClicked(const QModelIndex&)), - this, SLOT(slotDoubleClicked(const QModelIndex&))); + if (KGlobalSettings::singleClick()) { + connect(this, SIGNAL(clicked(const QModelIndex&)), + m_view->m_controller, SLOT(triggerItem(const QModelIndex&))); + } else { + connect(this, SIGNAL(doubleClicked(const QModelIndex&)), + m_view->m_controller, SLOT(triggerItem(const QModelIndex&))); + } if (selectionModel() && selectionModel()->currentIndex().isValid()) { selectionModel()->setCurrentIndex(selectionModel()->currentIndex(), QItemSelectionModel::SelectCurrent); @@ -564,12 +543,13 @@ void DolphinColumnWidget::activate() void DolphinColumnWidget::deactivate() { clearFocus(); - disconnect(this, SIGNAL(clicked(const QModelIndex&)), - m_view->m_controller, SLOT(requestTab(const QModelIndex&))); - disconnect(this, SIGNAL(clicked(const QModelIndex&)), - this, SLOT(slotClicked(const QModelIndex&))); - disconnect(this, SIGNAL(doubleClicked(const QModelIndex&)), - this, SLOT(slotDoubleClicked(const QModelIndex&))); + if (KGlobalSettings::singleClick()) { + disconnect(this, SIGNAL(clicked(const QModelIndex&)), + m_view->m_controller, SLOT(triggerItem(const QModelIndex&))); + } else { + disconnect(this, SIGNAL(doubleClicked(const QModelIndex&)), + m_view->m_controller, SLOT(triggerItem(const QModelIndex&))); + } const QModelIndex current = selectionModel()->currentIndex(); selectionModel()->clear(); diff --git a/src/dolphincolumnwidget.h b/src/dolphincolumnwidget.h index 02c9aea81..03e406f75 100644 --- a/src/dolphincolumnwidget.h +++ b/src/dolphincolumnwidget.h @@ -138,8 +138,6 @@ protected: private slots: void slotEntered(const QModelIndex& index); - void slotClicked(const QModelIndex& index); - void slotDoubleClicked(const QModelIndex& index); void requestActivation(); void updateFont();