]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistcontroller.cpp
Remove unused includes
[dolphin.git] / src / kitemviews / kitemlistcontroller.cpp
index 2c407dbe2d9afb7a9afbfca05b841636116fe3d1..7297f8aaa52d06ec0d47c6ce6d7a46ced9d096e2 100644 (file)
@@ -27,7 +27,6 @@
 #include <QGraphicsSceneEvent>
 #include <QGraphicsView>
 #include <QMimeData>
-#include <QStyleHints>
 #include <QTimer>
 #include <QTouchEvent>
 
@@ -53,7 +52,6 @@ KItemListController::KItemListController(KItemModelBase* model, KItemListView* v
     m_pressedIndex(std::nullopt),
     m_pressedMousePos(),
     m_autoActivationTimer(nullptr),
-    m_longPressDetectionTimer(nullptr),
     m_swipeGesture(Qt::CustomGesture),
     m_twoFingerTapGesture(Qt::CustomGesture),
     m_oldSelection(),
@@ -72,15 +70,6 @@ KItemListController::KItemListController(KItemModelBase* model, KItemListView* v
     m_autoActivationTimer->setInterval(-1);
     connect(m_autoActivationTimer, &QTimer::timeout, this, &KItemListController::slotAutoActivationTimeout);
 
-    m_longPressDetectionTimer = new QTimer(this);
-    m_longPressDetectionTimer->setSingleShot(true);
-    m_longPressDetectionTimer->setInterval(QGuiApplication::styleHints()->mousePressAndHoldInterval());
-    connect(m_longPressDetectionTimer, &QTimer::timeout, this, [this]() {
-        if (!m_selectionMode) {
-            Q_EMIT selectionModeChangeRequested(true);
-        }
-    });
-
     setModel(model);
     setView(view);
 
@@ -601,9 +590,6 @@ bool KItemListController::mouseMoveEvent(QGraphicsSceneMouseEvent* event, const
     }
 
     const QPointF pos = transform.map(event->pos());
-    if ((pos - m_pressedMousePos).manhattanLength() >= QApplication::startDragDistance()) {
-        m_longPressDetectionTimer->stop();
-    }
 
     if (m_pressedIndex.has_value() && !m_view->rubberBand()->isActive()) {
         // Check whether a dragging should be started
@@ -667,8 +653,6 @@ bool KItemListController::mouseReleaseEvent(QGraphicsSceneMouseEvent* event, con
         m_view->m_tapAndHoldIndicator->setActive(false);
     }
 
-    m_longPressDetectionTimer->stop();
-
     KItemListRubberBand* rubberBand = m_view->rubberBand();
     if (event->source() == Qt::MouseEventSynthesizedByQt && !rubberBand->isActive() && m_isTouchEvent) {
         return false;
@@ -1553,10 +1537,6 @@ bool KItemListController::onPress(const QPoint& screenPos, const QPointF& pos, c
     const bool leftClick = buttons & Qt::LeftButton;
     const bool rightClick = buttons & Qt::RightButton;
 
-    if (leftClick) {
-        m_longPressDetectionTimer->start();
-    }
-
     // The previous selection is cleared if either
     // 1. The selection mode is SingleSelection, or
     // 2. the selection mode is MultiSelection, and *none* of the following conditions are met: