From dc149ec5e52f52c514cf362603d05ba8eea506b8 Mon Sep 17 00:00:00 2001 From: Jin Liu Date: Thu, 29 Feb 2024 23:13:47 +0000 Subject: DragAndDropHelper::updateDropAction: use StatJob for remote URLs When dragging onto tabs/Places from a remote URL, we don't process the QDropEvent immediately, but start a StatJob and process the event when it finishes. Also, the result of the StatJob is cached for 30 seconds, to avoid starting duplicate jobs. --- src/panels/places/placespanel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/panels/places/placespanel.cpp') diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index ba3451bd5..eaf2642eb 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -15,7 +15,6 @@ #include "dolphin_placespanelsettings.h" #include "dolphinplacesmodelsingleton.h" #include "settings/dolphinsettingsdialog.h" -#include "views/draganddrophelper.h" #include #include @@ -32,6 +31,7 @@ PlacesPanel::PlacesPanel(QWidget *parent) : KFilePlacesView(parent) + , m_dragAndDropHelper(this) { setDropOnPlaceEnabled(true); connect(this, &PlacesPanel::urlsDropped, this, &PlacesPanel::slotUrlsDropped); @@ -161,7 +161,7 @@ void PlacesPanel::dragMoveEvent(QDragMoveEvent *event) if (!url.isValid() || !KProtocolManager::supportsWriting(url)) { event->setDropAction(Qt::IgnoreAction); } else { - DragAndDropHelper::updateDropAction(event, url); + m_dragAndDropHelper.updateDropAction(event, url); } } } -- cgit v1.3