diff options
| author | David Faure <[email protected]> | 2014-12-26 08:57:42 +0100 |
|---|---|---|
| committer | David Faure <[email protected]> | 2015-01-05 09:07:10 +0100 |
| commit | 7bd5bec21977c733dd3e1fc70f5afd66dda3ab97 (patch) | |
| tree | c05c3ecc54e25320dbd609ae65b6afdc23d07c0d /src/panels/places/placespanel.cpp | |
| parent | 119f7a3fce241efddc7e7f9eef8e729cf9ad35c2 (diff) | |
Dolphin: port from KonqOperations::doDrop to the new KIO::DropJob
REVIEW: 121678
Diffstat (limited to 'src/panels/places/placespanel.cpp')
| -rw-r--r-- | src/panels/places/placespanel.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
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 <KDirNotify> #include <QIcon> #include <KIO/Job> +#include <KIO/DropJob> #include <KIO/EmptyTrashJob> #include <KIO/JobUiDelegate> #include <KJobWidgets> @@ -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) |
