diff --git a/src/dolphincolumnwidget.cpp b/src/dolphincolumnwidget.cpp index 9a500df6b3..ab7945ea72 100644 --- a/src/dolphincolumnwidget.cpp +++ b/src/dolphincolumnwidget.cpp @@ -247,6 +247,20 @@ void DolphinColumnWidget::dragMoveEvent(QDragMoveEvent* event) } } setDirtyRegion(m_dropRect); + + bool destIsDir = false; + if (index.isValid()) { + const KFileItem item = itemForIndex(index); + if (!item.isNull() && item.isDir()) { + m_dropRect = visualRect(index); + destIsDir = true; + } + } else { // dropping on viewport + destIsDir = true; + } + if (destIsDir && event->mimeData()->hasUrls()) { + event->acceptProposedAction(); + } } void DolphinColumnWidget::dropEvent(QDropEvent* event) diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index 46752fc95a..f58b4cd1e2 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -278,6 +278,20 @@ void DolphinDetailsView::dragMoveEvent(QDragMoveEvent* event) } setDirtyRegion(m_dropRect); } + + bool destIsDir = false; + if (index.isValid()) { + const KFileItem item = itemForIndex(index); + if (!item.isNull() && item.isDir()) { + m_dropRect = visualRect(index); + destIsDir = true; + } + } else { // dropping on viewport + destIsDir = true; + } + if (destIsDir && event->mimeData()->hasUrls()) { + event->acceptProposedAction(); + } } void DolphinDetailsView::dropEvent(QDropEvent* event)