Package: kio / 5.62.1-2

report_error_removing_dirs Patch series | 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
46
47
48
49
50
51
52
53
54
55
56
57
58
From: Debian/Kubuntu Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Date: Thu, 31 Mar 2016 15:38:43 +0200
Subject: report_error_removing_dirs

===================================================================
---
 src/core/copyjob.cpp | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

--- a/src/core/copyjob.cpp
+++ b/src/core/copyjob.cpp
@@ -158,6 +158,7 @@
         , m_bOverwriteAllFiles(false)
         , m_bOverwriteAllDirs(false)
         , m_conflictError(0)
+        , m_dirsFailedError(0)
         , m_reportTimer(nullptr)
     {
     }
@@ -212,6 +213,8 @@
     bool m_bOverwriteAllFiles;
     bool m_bOverwriteAllDirs;
     int m_conflictError;
+    int m_dirsFailedError;
+    QString m_dirsFailedErrorText;
 
     QTimer *m_reportTimer;
 
@@ -1811,6 +1814,10 @@
             m_reportTimer->stop();
         }
 
+        if (m_dirsFailedError) {
+            q->setError(m_dirsFailedError);
+            q->setErrorText(m_dirsFailedErrorText);
+        }
         q->emitResult();
     }
 }
@@ -1878,12 +1885,14 @@
 void CopyJobPrivate::slotResultDeletingDirs(KJob *job)
 {
     Q_Q(CopyJob);
+    const QUrl url = static_cast<KIO::SimpleJob *>(job)->url();
     if (job->error()) {
-        // Couldn't remove directory. Well, perhaps it's not empty
-        // because the user pressed Skip for a given file in it.
-        // Let's not display "Could not remove dir ..." for each of those dir !
+        m_dirsFailedError = job->error();
+        m_dirsFailedErrorText = job->errorText();
+        // Remove the parents
+        skip(url, true);
     } else {
-        m_successSrcList.append(static_cast<KIO::SimpleJob *>(job)->url());
+        m_successSrcList.append(url);
     }
     q->removeSubjob(job);
     Q_ASSERT(!q->hasSubjobs());