From aa229c536b84d120e0b74661db10044f64d5a5b2 Mon Sep 17 00:00:00 2001 From: Rafał Lichwała Date: Fri, 13 Feb 2026 17:10:05 +0100 Subject: dolphinview: indicate drops from Places view This commit corrects previous attempt of bug fix done in https://invent.kde.org/frameworks/kio/-/commit/71b2b38b0c4fc4c7820fd95b031413d854d8f8c6?merge_request_iid=2074 which incorrectly recognized drop action from Places View (based only on missing Qt::MoveAction which had side effects described in BUG 514697) This time DolphinView indicates that the given dropEvent comes from Places View so we must avoid potentially destructive Move-like plugins actions. This is done by setting proper KIO::DropJobFlags additional flag for KIO::drop(). CCBUG: 509231 CCBUG: 514697 --- src/views/dolphinview.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/views/dolphinview.cpp') diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 7e01b9a93..b01833d69 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -1426,7 +1427,16 @@ void DolphinView::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent *even void DolphinView::dropUrls(const QUrl &destUrl, QDropEvent *dropEvent, QWidget *dropWidget) { - KIO::DropJob *job = DragAndDropHelper::dropUrls(destUrl, dropEvent, dropWidget); + KIO::DropJobFlags dropjobFlags; +#if KIO_VERSION >= QT_VERSION_CHECK(6, 23, 0) + if (qobject_cast(dropEvent->source())) { + // this drop comes from Places View so we want to avoid + // potentially destructive Move-like plugins actions + dropjobFlags |= KIO::DropJobFlag::ExcludePluginsActions; + } +#endif + + KIO::DropJob *job = DragAndDropHelper::dropUrls(destUrl, dropEvent, dropWidget, dropjobFlags); if (job) { connect(job, &KIO::DropJob::result, this, &DolphinView::slotJobResult); -- cgit v1.3