From: Rafael Fernández López Date: Tue, 18 Dec 2007 21:11:33 +0000 (+0000) Subject: The order is important, also is important to accept the event on the move event.... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/2446dd16e89e51e840489cf8cc1628116d323f36 The order is important, also is important to accept the event on the move event. While on the dock tree view we were always getting a forbidden cursor with no possibility to drop, now we can nicely drop :) CCMAIL: peter.penz@gmx.at svn path=/trunk/KDE/kdebase/apps/; revision=750176 --- diff --git a/src/sidebartreeview.cpp b/src/sidebartreeview.cpp index af676541a..d580cbf6d 100644 --- a/src/sidebartreeview.cpp +++ b/src/sidebartreeview.cpp @@ -106,10 +106,12 @@ void SidebarTreeView::startDrag(Qt::DropActions supportedActions) void SidebarTreeView::dragEnterEvent(QDragEnterEvent* event) { + QTreeView::dragEnterEvent(event); + if (event->mimeData()->hasUrls()) { event->acceptProposedAction(); } - QTreeView::dragEnterEvent(event); + m_dragging = true; } @@ -131,6 +133,11 @@ void SidebarTreeView::dragMoveEvent(QDragMoveEvent* event) setDirtyRegion(m_dropRect); m_dropRect = visualRect(index); setDirtyRegion(m_dropRect); + + if (event->mimeData()->hasUrls()) { + // accept url drops, independently from the destination item + event->acceptProposedAction(); + } } void SidebarTreeView::dropEvent(QDropEvent* event)