]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/places/placespanel.cpp
Improve DnD handling in read-only dirs
[dolphin.git] / src / panels / places / placespanel.cpp
index 2c19d8f29410bccf05889b0d59f9a06a5fa2dbfb..ba3451bd5e603f353e38fa4ec01f5e6590cceaf0 100644 (file)
@@ -156,9 +156,13 @@ void PlacesPanel::dragMoveEvent(QDragMoveEvent *event)
         // Reject drag ontop of a non-writable protocol
         // We don't know whether we're dropping inbetween or ontop of a place
         // so still allow internal drag events so that re-arranging still works.
-        const QUrl url = placesModel->url(index);
-        if (url.isValid() && !isInternalDrag(event->mimeData()) && !KProtocolManager::supportsWriting(url)) {
-            event->setDropAction(Qt::IgnoreAction);
+        if (!isInternalDrag(event->mimeData())) {
+            const QUrl url = placesModel->url(index);
+            if (!url.isValid() || !KProtocolManager::supportsWriting(url)) {
+                event->setDropAction(Qt::IgnoreAction);
+            } else {
+                DragAndDropHelper::updateDropAction(event, url);
+            }
         }
     }