From 3c83d8f14defbec5f09aeeb78de3885535d2dc71 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 8 Feb 2012 15:16:35 +0100 Subject: Drag and drop: Adjust destination if the item is no directory or desktop-file The URL of the view should be used as destination target if a dropping is not done above a directory or desktop-file. BUG: 293511 FIXED-IN: 4.8.1 --- src/views/dolphinview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/views/dolphinview.cpp') diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 16163c8e9..80be1e592 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -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(); } -- cgit v1.3