From 803bbd1ae191a89ffdb3889acb6621431525f96d Mon Sep 17 00:00:00 2001 From: Akseli Lahtinen Date: Fri, 8 Mar 2024 11:37:20 +0000 Subject: Start autoActivationTimer only if hovering over a directory Before starting autoActivationTimer, check that we're hovering the item on top of a directory. If we don't check for it, the the autoActivationTimer will try to open the hovered item in it's default application, which can be distracting and break the actual action the user was trying to do, like moving the file to a directory. BUG:479960 --- src/kitemviews/kitemlistcontroller.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/kitemviews/kitemlistcontroller.cpp') diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index aea59c711..2a0641aa1 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -827,11 +827,12 @@ bool KItemListController::dragMoveEvent(QGraphicsSceneDragDropEvent *event, cons Q_EMIT itemHovered(index); } - if (!m_autoActivationTimer->isActive() && m_autoActivationTimer->interval() >= 0) { + if (!m_autoActivationTimer->isActive() && m_autoActivationTimer->interval() >= 0 && m_model->canEnterOnHover(index)) { m_autoActivationTimer->setProperty("index", index); m_autoActivationTimer->start(); newHoveredWidget->startActivateSoonAnimation(m_autoActivationTimer->remainingTime()); } + } else { m_autoActivationTimer->stop(); if (newHoveredWidget && newHoveredWidget->isHovered()) { -- cgit v1.3