]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphindetailsview.cpp
You need >> or either the "Your names" and "Your messages" placeholders for translato...
[dolphin.git] / src / dolphindetailsview.cpp
index f4bba2f039c1748a264feae271081d854fcdfd94..55851dc95da294b3f030b6fc2373f7adb1df3399 100644 (file)
@@ -24,6 +24,7 @@
 #include "dolphincontroller.h"
 #include "dolphinsettings.h"
 #include "dolphinsortfilterproxymodel.h"
+#include "draganddrophelper.h"
 #include "viewproperties.h"
 
 #include "dolphin_detailsmodesettings.h"
@@ -212,6 +213,11 @@ void DolphinDetailsView::mouseReleaseEvent(QMouseEvent* event)
     }
 }
 
+void DolphinDetailsView::startDrag(Qt::DropActions supportedActions)
+{
+    DragAndDropHelper::startDrag(this, supportedActions);
+}
+
 void DolphinDetailsView::dragEnterEvent(QDragEnterEvent* event)
 {
     if (event->mimeData()->hasUrls()) {
@@ -245,7 +251,8 @@ void DolphinDetailsView::dragMoveEvent(QDragMoveEvent* event)
         m_dragging = false;
     } else {
         m_dragging = true;
-        if (itemForIndex(index).isDir()) {
+        const KFileItem item = itemForIndex(index);
+        if (!item.isNull() && item.isDir()) {
             m_dropRect = visualRect(index);
         } else {
             m_dropRect.setSize(QSize()); // set as invalid
@@ -294,7 +301,7 @@ void DolphinDetailsView::paintEvent(QPaintEvent* event)
     // TODO: remove this code when the issue #160611 is solved in Qt 4.4
     if (m_dragging) {
         const QBrush& brush = m_viewOptions.palette.brush(QPalette::Normal, QPalette::Highlight);
-        DolphinController::drawHoverIndication(viewport(), m_dropRect, brush);
+        DragAndDropHelper::drawHoverIndication(viewport(), m_dropRect, brush);
     }
 }