diff options
| author | Peter Penz <[email protected]> | 2012-01-05 20:41:59 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-01-05 20:44:46 +0100 |
| commit | 33eea8c9293b061d4483f17b7070c823ae8e001c (patch) | |
| tree | 1d974d7b60d6e30d59618e467c14c6dc79d9993d /src/kitemviews/kitemlistcontroller.cpp | |
| parent | c8d8556950005dfd96ebdb41d2f43ad90356367c (diff) | |
Folders Panel: Activate folders on single-click
Even if double-click is used as default setting, the folders panel should
open folders with a single-click.
BUG: 289971
FIXED-IN: 4.8.0
Diffstat (limited to 'src/kitemviews/kitemlistcontroller.cpp')
| -rw-r--r-- | src/kitemviews/kitemlistcontroller.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index 026c245f5..220748be7 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -41,6 +41,7 @@ KItemListController::KItemListController(QObject* parent) : QObject(parent), + m_singleClickActivation(KGlobalSettings::singleClick()), m_selectionTogglePressed(false), m_selectionBehavior(NoSelection), m_model(0), @@ -142,6 +143,16 @@ int KItemListController::autoActivationDelay() const return m_autoActivationTimer->interval(); } +void KItemListController::setSingleClickActivation(bool singleClick) +{ + m_singleClickActivation = singleClick; +} + +bool KItemListController::singleClickActivation() const +{ + return m_singleClickActivation; +} + bool KItemListController::showEvent(QShowEvent* event) { Q_UNUSED(event); @@ -577,7 +588,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 (!KGlobalSettings::singleClick()) { + } else if (!m_singleClickActivation) { emitItemActivated = false; } if (emitItemActivated) { @@ -598,7 +609,7 @@ bool KItemListController::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event, const QPointF pos = transform.map(event->pos()); const int index = m_view->itemAt(pos); - bool emitItemActivated = !KGlobalSettings::singleClick() && + bool emitItemActivated = !m_singleClickActivation && (event->button() & Qt::LeftButton) && index >= 0 && index < m_model->count(); if (emitItemActivated) { |
