From: Rafael Fernández López Date: Tue, 18 Dec 2007 20:17:57 +0000 (+0000) Subject: Keep consistent all views. Peter, if you decide to revert the change that David did... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/0ae60ef79bd44991a68fb8b1723fd807055f0307 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 --- 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)