X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/58d37b233177765b4908e2ab32413afe9fbd4da6..846b21edf57e7aeb83e84ee68e9f61c5981fbacd:/src/sidebartreeview.cpp diff --git a/src/sidebartreeview.cpp b/src/sidebartreeview.cpp index 9ab10a0b2..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) @@ -155,7 +162,7 @@ void SidebarTreeView::paintEvent(QPaintEvent* event) // TODO: remove this code when the issue #160611 is solved in Qt 4.4 if (m_dragging) { const QBrush& brush = palette().brush(QPalette::Normal, QPalette::Highlight); - DragAndDropHelper::drawHoverIndication(viewport(), m_dropRect, brush); + DragAndDropHelper::drawHoverIndication(this, m_dropRect, brush); } }