X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/6bccf73e9270e698e7ca23eb2dcaa05318e7b198..159234944c5717645f277a09d0cffb40fa3820a4:/src/kitemviews/kitemlistcontroller.cpp diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index e90f301a9..6c32e4b37 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) { @@ -1310,4 +1307,3 @@ void KItemListController::updateExtendedSelectionRegion() } } -#include "kitemlistcontroller.moc"