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/dolphinview.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/dolphinview.cpp')
| -rw-r--r-- | src/views/dolphinview.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 0edcb2894..f17749b83 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -815,7 +815,14 @@ void DolphinView::slotItemUnhovered(int index) void DolphinView::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event) { - const KFileItem destItem = fileItemModel()->fileItem(index); + KFileItem destItem = fileItemModel()->fileItem(index); + if (destItem.isNull()) { + destItem = fileItemModel()->rootItem(); + if (destItem.isNull()) { + kWarning() << "No destination item available for drop operation."; + return; + } + } QDropEvent dropEvent(event->pos().toPoint(), event->possibleActions(), @@ -823,7 +830,7 @@ void DolphinView::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* even event->buttons(), event->modifiers()); - const QString error = DragAndDropHelper::dropUrls(destItem, url(), &dropEvent); + const QString error = DragAndDropHelper::dropUrls(destItem, &dropEvent); if (!error.isEmpty()) { emit errorMessage(error); } |
