From 0ae60ef79bd44991a68fb8b1723fd807055f0307 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafael=20Fern=C3=A1ndez=20L=C3=B3pez?= Date: Tue, 18 Dec 2007 20:17:57 +0000 Subject: [PATCH] Keep consistent all views. Peter, if you decide to revert the change that David did on dolphiniconsview, do the revert here too. It really makes things very clear this way. Anyway, detailed and columns view were buggy since it did never accept the dragging events, so you were never able to drop on the detailed or column view. CCMAIL: peter.penz@gmx.at CCMAIL: faure@kde.org svn path=/trunk/KDE/kdebase/apps/; revision=750155 --- src/dolphincolumnwidget.cpp | 14 ++++++++++++++ src/dolphindetailsview.cpp | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/dolphincolumnwidget.cpp b/src/dolphincolumnwidget.cpp index 9a500df6b..ab7945ea7 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 46752fc95..f58b4cd1e 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) -- 2.47.3