File: upstream_6dd55251_DolphinView-display-errorMessage-when-copy-errors-occurs.patch

package info (click to toggle)
dolphin 4%3A25.04.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 31,252 kB
  • sloc: cpp: 46,852; xml: 878; ruby: 164; python: 84; sh: 11; makefile: 11
file content (45 lines) | stat: -rw-r--r-- 1,874 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 6dd5525131e13d42f515eba982a6e7cd1153effe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?M=C3=A9ven=20Car?= <meven@kde.org>
Date: Sun, 29 Jun 2025 11:20:44 +0200
Subject: [PATCH] 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
---
 src/views/dolphinview.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 9bbdc3b10e..e8577e0663 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);
 }
 
-- 
GitLab