X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/65b7e3b785e4f368f1b8cb39df9344bfd6324b4b..9cf54dcc025073f29e6a1f55c83c4edcec6a5ea3:/src/kitemviews/kitemlistcontroller.cpp diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index df940de7d..c6239df94 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -40,10 +40,11 @@ #include #include #include +#include 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), @@ -189,14 +190,14 @@ int KItemListController::autoActivationDelay() const 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) @@ -755,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 (!m_singleClickActivation) { + } else if (!(KGlobalSettings::singleClick() || m_singleClickActivationEnforced)) { emitItemActivated = false; } if (emitItemActivated) { @@ -785,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) { @@ -889,6 +890,8 @@ bool KItemListController::dropEvent(QGraphicsSceneDragDropEvent* event, const QT emit itemDropEvent(m_view->itemAt(pos), event); } + QAccessible::updateAccessibility(view(), 0, QAccessible::DragDropEnd); + return true; } @@ -1136,6 +1139,7 @@ void KItemListController::startDragging() drag->setHotSpot(hotSpot); drag->exec(Qt::MoveAction | Qt::CopyAction | Qt::LinkAction, Qt::CopyAction); + QAccessible::updateAccessibility(view(), 0, QAccessible::DragDropStart); } KItemListWidget* KItemListController::hoveredWidget() const