X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/b96def1856bfd043ba7dae56368ceed6940bd6c4..c725848709:/src/panels/places/placespanel.cpp diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index b04191f1c..631b6b69d 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -375,11 +376,7 @@ void PlacesPanel::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* even event->buttons(), event->modifiers()); - QString error; - DragAndDropHelper::dropUrls(KFileItem(), destUrl, &dropEvent, error); - if (!error.isEmpty()) { - emit errorMessage(error); - } + slotUrlsDropped(destUrl, &dropEvent, this); } void PlacesPanel::slotItemDropEventStorageSetupDone(int index, bool success) @@ -390,12 +387,7 @@ void PlacesPanel::slotItemDropEventStorageSetupDone(int index, bool success) if ((index == m_itemDropEventIndex) && m_itemDropEvent && m_itemDropEventMimeData) { if (success) { QUrl destUrl = m_model->placesItem(index)->url(); - - QString error; - DragAndDropHelper::dropUrls(KFileItem(), destUrl, m_itemDropEvent, error); - if (!error.isEmpty()) { - emit errorMessage(error); - } + slotUrlsDropped(destUrl, m_itemDropEvent, this); } delete m_itemDropEventMimeData; @@ -414,13 +406,10 @@ void PlacesPanel::slotAboveItemDropEvent(int index, QGraphicsSceneDragDropEvent* void PlacesPanel::slotUrlsDropped(const QUrl& dest, QDropEvent* event, QWidget* parent) { - Q_UNUSED(parent); - QString error; - DragAndDropHelper::dropUrls(KFileItem(), dest, event, error); - if (!error.isEmpty()) { - emit errorMessage(error); + KIO::DropJob *job = DragAndDropHelper::dropUrls(dest, event, parent); + if (job) { + connect(job, &KIO::DropJob::result, this, [this](KJob *job) { if (job->error()) emit errorMessage(job->errorString()); }); } - } void PlacesPanel::slotTrashUpdated(KJob* job)