diff options
| author | Jin Liu <[email protected]> | 2024-02-17 11:14:46 +0000 |
|---|---|---|
| committer | Jin Liu <[email protected]> | 2024-02-17 11:14:46 +0000 |
| commit | c9c3531c0b6da07de8f90761a3d799ace62f8e89 (patch) | |
| tree | e03fa5263d491c31cabf3cad429adf2297f768d2 /src/panels | |
| parent | cda139ccab2c78ac71a9f2aad286cbe1ace46734 (diff) | |
Improve DnD handling in read-only dirs
1. Places panel and tabbar update drag status in read-only dir
2. Don't create drop job in readonly directories
Diffstat (limited to 'src/panels')
| -rw-r--r-- | src/panels/places/placespanel.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 2c19d8f29..ba3451bd5 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -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); + } } } |
