]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphincolumnwidget.cpp
Keep consistent all views. Peter, if you decide to revert the change that David did...
[dolphin.git] / src / dolphincolumnwidget.cpp
index 9a500df6b379f234e198256c97aebaf4a24e1cc1..ab7945ea721099278bbd23a26d6a8c3e9e583a12 100644 (file)
@@ -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)