┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/dolphinview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-12-20 08:56:32 +0100
committerPeter Penz <[email protected]>2011-12-20 08:58:24 +0100
commit090393599c80d29439a7e5f63e7bba471f52639d (patch)
treee957a8dc19073a489210bae0489c069f04e67f18 /src/views/dolphinview.cpp
parenta3c41997db62e9af2a89b23a61bc7dda75aa1e58 (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.cpp11
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);
}