]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Don't open folders on a single-click in the column view when the mouse settings speci...
authorPeter Penz <peter.penz19@gmail.com>
Sat, 11 Jul 2009 18:56:03 +0000 (18:56 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sat, 11 Jul 2009 18:56:03 +0000 (18:56 +0000)
BUG: 198464

svn path=/trunk/KDE/kdebase/apps/; revision=995029

src/dolphincolumnwidget.cpp
src/dolphincolumnwidget.h

index c8bff02908972b0183bf607d02a1cccb3102206e..b4c9f11c13bade4f0499b9f4b881ba5085b54a7a 100644 (file)
@@ -500,28 +500,6 @@ void DolphinColumnWidget::slotEntered(const QModelIndex& index)
     m_view->m_controller->emitItemEntered(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);
 void DolphinColumnWidget::requestActivation()
 {
     m_view->m_controller->setItemView(this);
@@ -547,12 +525,13 @@ void DolphinColumnWidget::activate()
 {
     setFocus(Qt::OtherFocusReason);
 
 {
     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);
 
     if (selectionModel() && selectionModel()->currentIndex().isValid()) {
         selectionModel()->setCurrentIndex(selectionModel()->currentIndex(), QItemSelectionModel::SelectCurrent);
@@ -564,12 +543,13 @@ void DolphinColumnWidget::activate()
 void DolphinColumnWidget::deactivate()
 {
     clearFocus();
 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();
 
     const QModelIndex current = selectionModel()->currentIndex();
     selectionModel()->clear();
index 02c9aea8174a1115f0426f9b27b82366e58bfdae..03e406f7551d0cf6a684d9f3a89fab308d8902a1 100644 (file)
@@ -138,8 +138,6 @@ protected:
 
 private slots:
     void slotEntered(const QModelIndex& index);
 
 private slots:
     void slotEntered(const QModelIndex& index);
-    void slotClicked(const QModelIndex& index);
-    void slotDoubleClicked(const QModelIndex& index);
     void requestActivation();
     void updateFont();
 
     void requestActivation();
     void updateFont();