X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/54713bab0b387bda14ee3733bc55f9755555e97f..c8d8556950005dfd96ebdb41d2f43ad90356367c:/src/views/draganddrophelper.cpp diff --git a/src/views/draganddrophelper.cpp b/src/views/draganddrophelper.cpp index ea92787ab..91eb4267d 100644 --- a/src/views/draganddrophelper.cpp +++ b/src/views/draganddrophelper.cpp @@ -28,12 +28,14 @@ #include #include -QString DragAndDropHelper::dropUrls(const KFileItem& destItem, - const KUrl& destPath, - QDropEvent* event) +QString DragAndDropHelper::dropUrls(const KFileItem& destItem, QDropEvent* event) { - const bool dropToItem = !destItem.isNull() && (destItem.isDir() || destItem.isDesktopFile()); - const KUrl destination = dropToItem ? destItem.url() : destPath; + Q_ASSERT(!destItem.isNull()); + + const KUrl destination = destItem.url(); + if (!destItem.isWritable()) { + return i18nc("@info:status", "Access denied. Could not write to %1", destination.pathOrUrl()); + } const QMimeData* mimeData = event->mimeData(); if (mimeData->hasFormat("application/x-kde-dndextract")) { @@ -50,11 +52,7 @@ QString DragAndDropHelper::dropUrls(const KFileItem& destItem, } } - if (dropToItem) { - KonqOperations::doDrop(destItem, destination, event, QApplication::activeWindow()); - } else { - KonqOperations::doDrop(KFileItem(), destination, event, QApplication::activeWindow()); - } + KonqOperations::doDrop(destItem, destination, event, QApplication::activeWindow()); } return QString();