]> cloud.milkyroute.net Git - dolphin.git/commitdiff
The column view did not obey single/double-click navigation settings, it does now...
authorShaun Reich <shaun.reich@kdemail.net>
Fri, 6 Feb 2009 02:52:23 +0000 (02:52 +0000)
committerShaun Reich <shaun.reich@kdemail.net>
Fri, 6 Feb 2009 02:52:23 +0000 (02:52 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=921975

src/dolphincolumnwidget.cpp

index 4a6527c1bed6ea3b896e32a7b5d87193504082e7..037818cecdaf94082c5a3b782de9502101405389 100644 (file)
@@ -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);