]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/dolphinview.cpp
Test which items are activated when pressing Enter or Return
[dolphin.git] / src / views / dolphinview.cpp
index 661ce101bbe7f4c55e9d918eb4d893a875dd6c6d..80be1e592c63991c95a30d6520bc92b1f1375720 100644 (file)
@@ -694,6 +694,12 @@ void DolphinView::wheelEvent(QWheelEvent* event)
     }
 }
 
+void DolphinView::hideEvent(QHideEvent* event)
+{
+    hideToolTip();
+    QWidget::hideEvent(event);
+}
+
 void DolphinView::activate()
 {
     setActive(true);
@@ -824,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();
     }