Debian Codegraph @

debian/patches/report_error_removing_dirs

raw
1 From: Debian/Kubuntu Qt/KDE Maintainers <[email protected]>
2 Date: Thu, 31 Mar 2016 15:38:43 +0200
3 Subject: report_error_removing_dirs
4 Last-Updated: 2024-12-04
5
6 ===================================================================
7 ---
8 src/core/copyjob.cpp | 17 +++++++++++++----
9 1 file changed, 13 insertions(+), 4 deletions(-)
10
11 --- a/src/core/copyjob.cpp
12 +++ b/src/core/copyjob.cpp
13 @@ -263,6 +263,7 @@ public:
14 , m_bOverwriteAllDirs(false)
15 , m_bOverwriteWhenOlder(false)
16 , m_conflictError(0)
17 + , m_dirsFailedError(0)
18 , m_reportTimer(nullptr)
19 {
20 }
21 @@ -337,6 +338,8 @@ public:
22 };
23
24 int m_conflictError;
25 + int m_dirsFailedError;
26 + QString m_dirsFailedErrorText;
27
28 QTimer *m_reportTimer;
29 QElapsedTimer m_speedMeasurementTimer;
30 @@ -2211,6 +2214,10 @@ void CopyJobPrivate::setNextDirAttribute
31 m_reportTimer->stop();
32 }
33
34 + if (m_dirsFailedError) {
35 + q->setError(m_dirsFailedError);
36 + q->setErrorText(m_dirsFailedErrorText);
37 + }
38 q->emitResult();
39 }
40 }
41 @@ -2313,12 +2320,14 @@ void CopyJobPrivate::slotTotalSize(KJob
42 void CopyJobPrivate::slotResultDeletingDirs(KJob *job)
43 {
44 Q_Q(CopyJob);
45 + const QUrl url = static_cast<KIO::SimpleJob *>(job)->url();
46 if (job->error()) {
47 - // Couldn't remove directory. Well, perhaps it's not empty
48 - // because the user pressed Skip for a given file in it.
49 - // Let's not display "Could not remove dir ..." for each of those dir !
50 + m_dirsFailedError = job->error();
51 + m_dirsFailedErrorText = job->errorText();
52 + // Remove the parents
53 + skip(url, true);
54 } else {
55 - m_successSrcList.append(static_cast<KIO::SimpleJob *>(job)->url());
56 + m_successSrcList.append(url);
57 }
58 q->removeSubjob(job);
59 Q_ASSERT(!q->hasSubjobs());