]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinview.cpp
Drag and drop: Adjust destination if the item is no directory or desktop-file
[dolphin.git] / src / views / dolphinview.cpp
index 16163c8e91301aadfcf34a336820938944b2d5b1..80be1e592c63991c95a30d6520bc92b1f1375720 100644 (file)
@@ -830,10 +830,13 @@ void DolphinView::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* even
 {
     KUrl destUrl;
     KFileItem destItem = fileItemModel()->fileItem(index);
-    if (destItem.isNull()) {
+    if (destItem.isNull() || (!destItem.isDir() && !destItem.isDesktopFile())) {
+        // Use the URL of the view as drop target if the item is no directory
+        // or desktop-file
         destItem = fileItemModel()->rootItem();
         destUrl = url();
     } else {
+        // The item represents a directory or desktop-file
         destUrl = destItem.url();
     }