Changeset View
Changeset View
Standalone View
Standalone View
src/core/mkpathjob.cpp
Show All 19 Lines | |||||
20 | 20 | | |||
21 | #include "mkpathjob.h" | 21 | #include "mkpathjob.h" | ||
22 | 22 | | |||
23 | #include "job_p.h" | 23 | #include "job_p.h" | ||
24 | 24 | | |||
25 | #include "mkdirjob.h" | 25 | #include "mkdirjob.h" | ||
26 | #include <QTimer> | 26 | #include <QTimer> | ||
27 | #include <QDebug> | 27 | #include <QDebug> | ||
28 | #include <QDir> | ||||
28 | #include <QFileInfo> | 29 | #include <QFileInfo> | ||
29 | 30 | | |||
30 | using namespace KIO; | 31 | using namespace KIO; | ||
31 | 32 | | |||
32 | class KIO::MkpathJobPrivate : public KIO::JobPrivate | 33 | class KIO::MkpathJobPrivate : public KIO::JobPrivate | ||
33 | { | 34 | { | ||
34 | public: | 35 | public: | ||
35 | MkpathJobPrivate(const QUrl &url, const QUrl &baseUrl, JobFlags flags) | 36 | MkpathJobPrivate(const QUrl &url, const QUrl &baseUrl, JobFlags flags) | ||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | |||||
118 | { | 119 | { | ||
119 | Q_Q(MkpathJob); | 120 | Q_Q(MkpathJob); | ||
120 | 121 | | |||
121 | if (m_pathIterator == m_pathComponents.constBegin()) { // first time: emit total | 122 | if (m_pathIterator == m_pathComponents.constBegin()) { // first time: emit total | ||
122 | q->setTotalAmount(KJob::Directories, m_pathComponents.count()); | 123 | q->setTotalAmount(KJob::Directories, m_pathComponents.count()); | ||
123 | } | 124 | } | ||
124 | 125 | | |||
125 | if (m_pathIterator != m_pathComponents.constEnd()) { | 126 | if (m_pathIterator != m_pathComponents.constEnd()) { | ||
126 | m_url.setPath(m_url.path() + '/' + *m_pathIterator); | 127 | m_url.setPath(QDir::cleanPath(m_url.path() + '/' + *m_pathIterator)); | ||
127 | KIO::Job* job = KIO::mkdir(m_url); | 128 | KIO::Job* job = KIO::mkdir(m_url); | ||
128 | q->addSubjob(job); | 129 | q->addSubjob(job); | ||
129 | q->setProcessedAmount(KJob::Directories, q->processedAmount(KJob::Directories) + 1); | 130 | q->setProcessedAmount(KJob::Directories, q->processedAmount(KJob::Directories) + 1); | ||
130 | } else { | 131 | } else { | ||
131 | q->emitResult(); | 132 | q->emitResult(); | ||
132 | } | 133 | } | ||
133 | } | 134 | } | ||
134 | 135 | | |||
Show All 23 Lines |