X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/6bccf73e9270e698e7ca23eb2dcaa05318e7b198..16e3d669de256aab86f957cd5b3bee91bd2fbbff:/src/kitemviews/kitemlistcontroller.cpp diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index e90f301a9..1c86ff03f 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -23,8 +23,6 @@ #include "kitemlistcontroller.h" -#include -#include #include "kitemlistview.h" #include "kitemlistselectionmanager.h" @@ -538,8 +536,7 @@ bool KItemListController::mousePressEvent(QGraphicsSceneMouseEvent* event, const m_pressedIndex = m_view->itemAt(m_pressedMousePos); emit mouseButtonPressed(m_pressedIndex, event->buttons()); - // TODO: Qt5: Replace Qt::XButton1 by Qt::BackButton and Qt::XButton2 by Qt::ForwardButton - if (event->buttons() & (Qt::XButton1 | Qt::XButton2)) { + if (event->buttons() & (Qt::BackButton | Qt::ForwardButton)) { // Do not select items when clicking the back/forward buttons, see // https://bugs.kde.org/show_bug.cgi?id=327412. return true; @@ -774,7 +771,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() || m_singleClickActivationEnforced)) { + } else if (!(m_view->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick) || m_singleClickActivationEnforced)) { emitItemActivated = false; } if (emitItemActivated) { @@ -804,7 +801,7 @@ bool KItemListController::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event, } } - bool emitItemActivated = !(KGlobalSettings::singleClick() || m_singleClickActivationEnforced) && + bool emitItemActivated = !(m_view->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick) || m_singleClickActivationEnforced) && (event->button() & Qt::LeftButton) && index >= 0 && index < m_model->count(); if (emitItemActivated) { @@ -920,7 +917,8 @@ bool KItemListController::dropEvent(QGraphicsSceneDragDropEvent* event, const QT emit itemDropEvent(m_view->itemAt(pos), event); } - QAccessible::updateAccessibility(view(), 0, QAccessible::DragDropEnd); + QAccessibleEvent accessibilityEvent(view(), QAccessible::DragDropEnd); + QAccessible::updateAccessibility(&accessibilityEvent); return true; } @@ -1170,11 +1168,13 @@ void KItemListController::startDragging() const QPixmap pixmap = m_view->createDragPixmap(selectedItems); drag->setPixmap(pixmap); - const QPoint hotSpot(pixmap.width() / 2, 0); + const QPoint hotSpot((pixmap.width() / pixmap.devicePixelRatio()) / 2, 0); drag->setHotSpot(hotSpot); drag->exec(Qt::MoveAction | Qt::CopyAction | Qt::LinkAction, Qt::CopyAction); - QAccessible::updateAccessibility(view(), 0, QAccessible::DragDropStart); + + QAccessibleEvent accessibilityEvent(view(), QAccessible::DragDropStart); + QAccessible::updateAccessibility(&accessibilityEvent); } KItemListWidget* KItemListController::hoveredWidget() const @@ -1310,4 +1310,3 @@ void KItemListController::updateExtendedSelectionRegion() } } -#include "kitemlistcontroller.moc"