From: Méven Car Date: Sun, 29 Jun 2025 09:20:44 +0000 (+0200) Subject: DolphinView: display errorMessage when copy errors occurs X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/6dd5525131e13d42f515eba982a6e7cd1153effe DolphinView: display errorMessage when copy errors occurs when copying multiple files. CopyJob skip those by default (CopyJobPrivate::slotSubError), and emits warning. Hook this to errorMessage. We would need to improve this as only the last error Message will be visible. BUG: 506282 --- diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 9bbdc3b10..e8577e066 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -846,6 +846,9 @@ void DolphinView::copySelectedItems(const KFileItemList &selection, const QUrl & connect(job, &KIO::CopyJob::result, this, &DolphinView::slotJobResult); connect(job, &KIO::CopyJob::copying, this, &DolphinView::slotItemCreatedFromJob); connect(job, &KIO::CopyJob::copyingDone, this, &DolphinView::slotItemCreatedFromJob); + connect(job, &KIO::CopyJob::warning, this, [](KJob *job, const QString &warning) { + Q_EMIT errorMessage(job->errorString(), job->error()); + }); KIO::FileUndoManager::self()->recordCopyJob(job); } @@ -865,6 +868,9 @@ void DolphinView::moveSelectedItems(const KFileItemList &selection, const QUrl & connect(job, &KIO::CopyJob::result, this, &DolphinView::slotJobResult); connect(job, &KIO::CopyJob::moving, this, &DolphinView::slotItemCreatedFromJob); connect(job, &KIO::CopyJob::copyingDone, this, &DolphinView::slotItemCreatedFromJob); + connect(job, &KIO::CopyJob::warning, this, [](KJob *job, const QString &warning) { + Q_EMIT errorMessage(job->errorString(), job->error()); + }); KIO::FileUndoManager::self()->recordCopyJob(job); }