From: Shaun Reich Date: Fri, 6 Feb 2009 02:52:23 +0000 (+0000) Subject: The column view did not obey single/double-click navigation settings, it does now... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/2a3e27b9fe8beae4fb93dce428c692936caaa03c The column view did not obey single/double-click navigation settings, it does now. The signals were only connected to the singleClick(), not the doubleClick() method. They are now also connected/disconnected according to the setting that is set globally. svn path=/trunk/KDE/kdebase/apps/; revision=921975 --- diff --git a/src/dolphincolumnwidget.cpp b/src/dolphincolumnwidget.cpp index 4a6527c1b..037818cec 100644 --- a/src/dolphincolumnwidget.cpp +++ b/src/dolphincolumnwidget.cpp @@ -414,7 +414,7 @@ void DolphinColumnWidget::contextMenuEvent(QContextMenuEvent* event) const QPoint pos = m_view->viewport()->mapFromGlobal(event->globalPos()); Q_ASSERT(m_view->m_controller->itemView() == this); - m_view->m_controller->triggerContextMenuRequest(pos); + m_view->m_controller->triggerContextMenuRequest(event->pos()); } void DolphinColumnWidget::wheelEvent(QWheelEvent* event) @@ -493,10 +493,17 @@ void DolphinColumnWidget::activate() { setFocus(Qt::OtherFocusReason); - connect(this, SIGNAL(clicked(const QModelIndex&)), + if (KGlobalSettings::singleClick()) { + connect(this, SIGNAL(clicked(const QModelIndex&)), m_view->m_controller, SLOT(requestTab(const QModelIndex&))); - connect(this, SIGNAL(clicked(const QModelIndex&)), + 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(requestTab(const QModelIndex&))); + 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); @@ -507,10 +514,17 @@ void DolphinColumnWidget::activate() void DolphinColumnWidget::deactivate() { clearFocus(); - - disconnect(this, SIGNAL(clicked(const QModelIndex&)), - m_view->m_controller, SLOT(triggerItem(const QModelIndex&))); - + if (KGlobalSettings::singleClick()) { + disconnect(this, SIGNAL(clicked(const QModelIndex&)), + m_view->m_controller, SLOT(requestTab(const QModelIndex&))); + 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(requestTab(const QModelIndex&))); + disconnect(this, SIGNAL(doubleClicked(const QModelIndex&)), + m_view->m_controller, SLOT(triggerItem(const QModelIndex&))); + } const QModelIndex current = selectionModel()->currentIndex(); selectionModel()->clear(); selectionModel()->setCurrentIndex(current, QItemSelectionModel::NoUpdate);