From 090393599c80d29439a7e5f63e7bba471f52639d Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Tue, 20 Dec 2011 08:56:32 +0100 Subject: Show an error when dragging above a folder without write access Got OK from the translator team to add this new string. --- src/views/draganddrophelper.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to '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(); -- cgit v1.3