]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinview.cpp
Fix drag & drop issues with non-local URLs
[dolphin.git] / src / views / dolphinview.cpp
index 83d80012cbca8c36b8da3dfa489a5894c218f45c..1e300c5cf25331129eecb2ec9fee969ca6e62594 100644 (file)
@@ -809,13 +809,13 @@ void DolphinView::slotItemUnhovered(int index)
 
 void DolphinView::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event)
 {
+    KUrl destUrl;
     KFileItem destItem = fileItemModel()->fileItem(index);
     if (destItem.isNull()) {
         destItem = fileItemModel()->rootItem();
-        if (destItem.isNull()) {
-            kWarning() << "No destination item available for drop operation.";
-            return;
-        }
+        destUrl = url();
+    } else {
+        destUrl = destItem.url();
     }
 
     QDropEvent dropEvent(event->pos().toPoint(),
@@ -824,7 +824,7 @@ void DolphinView::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* even
                          event->buttons(),
                          event->modifiers());
 
-    const QString error = DragAndDropHelper::dropUrls(destItem, &dropEvent);
+    const QString error = DragAndDropHelper::dropUrls(destItem, destUrl, &dropEvent);
     if (!error.isEmpty()) {
         emit errorMessage(error);
     }
@@ -863,16 +863,6 @@ void DolphinView::emitSelectionChangedSignal()
     emit selectionChanged(selectedItems());
 }
 
-void DolphinView::dropUrls(const KFileItem& destItem,
-                           const KUrl& destPath,
-                           QDropEvent* event)
-{
-    Q_UNUSED(destItem);
-    Q_UNUSED(destPath);
-    markPastedUrlsAsSelected(event->mimeData());
-    //DragAndDropHelper::instance().dropUrls(destItem, destPath, event, this);
-}
-
 void DolphinView::updateSorting(DolphinView::Sorting sorting)
 {
     ViewProperties props(url());