diff options
| author | Peter Penz <[email protected]> | 2011-12-20 08:56:32 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-12-20 08:58:24 +0100 |
| commit | 090393599c80d29439a7e5f63e7bba471f52639d (patch) | |
| tree | e957a8dc19073a489210bae0489c069f04e67f18 /src/views/draganddrophelper.cpp | |
| parent | a3c41997db62e9af2a89b23a61bc7dda75aa1e58 (diff) | |
Show an error when dragging above a folder without write access
Got OK from the translator team to add this new string.
Diffstat (limited to 'src/views/draganddrophelper.cpp')
| -rw-r--r-- | src/views/draganddrophelper.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
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 <QtDBus> #include <QDropEvent> -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 <filename>%1</filename>", 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(); |
