]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Apply changes of the KGlobalSettings::singleClick() setting immediately
authorAniket Anvit <seeanvit@gmail.com>
Tue, 5 Feb 2013 18:58:06 +0000 (19:58 +0100)
committerFrank Reininghaus <frank78ac@googlemail.com>
Tue, 5 Feb 2013 18:58:06 +0000 (19:58 +0100)
Fixes a regression introduced by commit
7a364cbf489af25e123d18713523151a3a53f814.

Patch reviewed and pushed by Frank Reininghaus.

BUG: 313342
FIXED-IN: 4.10.1

src/kitemviews/kitemlistcontroller.cpp
src/kitemviews/kitemlistcontroller.h
src/panels/folders/folderspanel.cpp
src/panels/places/placespanel.cpp

index 697e04fefcc8fbabf48b765f712af2a9123baf24..c6239df94150560a5e24fe6e85d3e85155c88d17 100644 (file)
@@ -44,7 +44,7 @@
 
 KItemListController::KItemListController(KItemModelBase* model, KItemListView* view, QObject* parent) :
     QObject(parent),
 
 KItemListController::KItemListController(KItemModelBase* model, KItemListView* view, QObject* parent) :
     QObject(parent),
-    m_singleClickActivation(KGlobalSettings::singleClick()),
+    m_singleClickActivationEnforced(false),
     m_selectionTogglePressed(false),
     m_clearSelectionIfItemsAreNotDragged(false),
     m_selectionBehavior(NoSelection),
     m_selectionTogglePressed(false),
     m_clearSelectionIfItemsAreNotDragged(false),
     m_selectionBehavior(NoSelection),
@@ -190,14 +190,14 @@ int KItemListController::autoActivationDelay() const
     return m_autoActivationTimer->interval();
 }
 
     return m_autoActivationTimer->interval();
 }
 
-void KItemListController::setSingleClickActivation(bool singleClick)
+void KItemListController::setSingleClickActivationEnforced(bool singleClick)
 {
 {
-    m_singleClickActivation = singleClick;
+    m_singleClickActivationEnforced = singleClick;
 }
 
 }
 
-bool KItemListController::singleClickActivation() const
+bool KItemListController::singleClickActivationEnforced() const
 {
 {
-    return m_singleClickActivation;
+    return m_singleClickActivationEnforced;
 }
 
 bool KItemListController::showEvent(QShowEvent* event)
 }
 
 bool KItemListController::showEvent(QShowEvent* event)
@@ -756,7 +756,7 @@ bool KItemListController::mouseReleaseEvent(QGraphicsSceneMouseEvent* event, con
             } else if (shiftOrControlPressed) {
                 // The mouse click should only update the selection, not trigger the item
                 emitItemActivated = false;
             } else if (shiftOrControlPressed) {
                 // The mouse click should only update the selection, not trigger the item
                 emitItemActivated = false;
-            } else if (!m_singleClickActivation) {
+            } else if (!(KGlobalSettings::singleClick() || m_singleClickActivationEnforced)) {
                 emitItemActivated = false;
             }
             if (emitItemActivated) {
                 emitItemActivated = false;
             }
             if (emitItemActivated) {
@@ -786,7 +786,7 @@ bool KItemListController::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event,
         }
     }
 
         }
     }
 
-    bool emitItemActivated = !m_singleClickActivation &&
+    bool emitItemActivated = !(KGlobalSettings::singleClick() || m_singleClickActivationEnforced) &&
                              (event->button() & Qt::LeftButton) &&
                              index >= 0 && index < m_model->count();
     if (emitItemActivated) {
                              (event->button() & Qt::LeftButton) &&
                              index >= 0 && index < m_model->count();
     if (emitItemActivated) {
index 235e4a9eb41e7dc8c13e89fd60ef151ab3a8ded8..4d5fee3450fa8e391dc881f1878e057e863290b0 100644 (file)
@@ -129,12 +129,11 @@ public:
 
     /**
      * If set to true, the signals itemActivated() and itemsActivated() are emitted
 
     /**
      * If set to true, the signals itemActivated() and itemsActivated() are emitted
-     * after a single-click of the left mouse button. If set to false, a double-click
-     * is required. Per default the setting from KGlobalSettings::singleClick() is
-     * used.
+     * after a single-click of the left mouse button. If set to false (the default), 
+     * the setting from KGlobalSettings::singleClick() is used.
      */
      */
-    void setSingleClickActivation(bool singleClick);
-    bool singleClickActivation() const;
+    void setSingleClickActivationEnforced(bool singleClick);
+    bool singleClickActivationEnforced() const;
 
     virtual bool showEvent(QShowEvent* event);
     virtual bool hideEvent(QHideEvent* event);
 
     virtual bool showEvent(QShowEvent* event);
     virtual bool hideEvent(QHideEvent* event);
@@ -301,7 +300,7 @@ private:
     void updateExtendedSelectionRegion();
 
 private:
     void updateExtendedSelectionRegion();
 
 private:
-    bool m_singleClickActivation;
+    bool m_singleClickActivationEnforced;
     bool m_selectionTogglePressed;
     bool m_clearSelectionIfItemsAreNotDragged;
     SelectionBehavior m_selectionBehavior;
     bool m_selectionTogglePressed;
     bool m_clearSelectionIfItemsAreNotDragged;
     SelectionBehavior m_selectionBehavior;
index 6e3a7678f6490b8382b7414b8e0bf29dffcb3ba1..98c06fb35ecf672fbdcbf752ceae6469bb141cc2 100644 (file)
@@ -152,7 +152,7 @@ void FoldersPanel::showEvent(QShowEvent* event)
         m_controller->setAutoActivationBehavior(KItemListController::ExpansionOnly);
         m_controller->setMouseDoubleClickAction(KItemListController::ActivateAndExpandItem);
         m_controller->setAutoActivationDelay(750);
         m_controller->setAutoActivationBehavior(KItemListController::ExpansionOnly);
         m_controller->setMouseDoubleClickAction(KItemListController::ActivateAndExpandItem);
         m_controller->setAutoActivationDelay(750);
-        m_controller->setSingleClickActivation(true);
+        m_controller->setSingleClickActivationEnforced(true);
 
         connect(m_controller, SIGNAL(itemActivated(int)), this, SLOT(slotItemActivated(int)));
         connect(m_controller, SIGNAL(itemMiddleClicked(int)), this, SLOT(slotItemMiddleClicked(int)));
 
         connect(m_controller, SIGNAL(itemActivated(int)), this, SLOT(slotItemActivated(int)));
         connect(m_controller, SIGNAL(itemMiddleClicked(int)), this, SLOT(slotItemMiddleClicked(int)));
index 61c15a7a12631d0a8d36e96e0298cd96646f5d32..919f2ed45e29fead3a117403a080c2b2a750d6e1 100644 (file)
@@ -110,7 +110,7 @@ void PlacesPanel::showEvent(QShowEvent* event)
 
         m_controller = new KItemListController(m_model, m_view, this);
         m_controller->setSelectionBehavior(KItemListController::SingleSelection);
 
         m_controller = new KItemListController(m_model, m_view, this);
         m_controller->setSelectionBehavior(KItemListController::SingleSelection);
-        m_controller->setSingleClickActivation(true);
+        m_controller->setSingleClickActivationEnforced(true);
 
        readSettings();
 
 
        readSettings();