Changeset View
Changeset View
Standalone View
Standalone View
src/core/copyjob.cpp
Show First 20 Lines • Show All 328 Lines • ▼ Show 20 Line(s) | |||||
329 | 329 | | |||
330 | void CopyJobPrivate::slotStart() | 330 | void CopyJobPrivate::slotStart() | ||
331 | { | 331 | { | ||
332 | Q_Q(CopyJob); | 332 | Q_Q(CopyJob); | ||
333 | if (q->isSuspended()) { | 333 | if (q->isSuspended()) { | ||
334 | return; | 334 | return; | ||
335 | } | 335 | } | ||
336 | if (m_mode == CopyJob::CopyMode::Move) { | 336 | if (m_mode == CopyJob::CopyMode::Move) { | ||
337 | Q_FOREACH (const QUrl &url, m_srcList) { | 337 | for (const QUrl &url : qAsConst(m_srcList)) { | ||
338 | if (m_dest.scheme() == url.scheme() && m_dest.host() == url.host()) { | 338 | if (m_dest.scheme() == url.scheme() && m_dest.host() == url.host()) { | ||
339 | QString srcPath = url.path(); | 339 | QString srcPath = url.path(); | ||
340 | if (!srcPath.endsWith(QLatin1Char('/'))) | 340 | if (!srcPath.endsWith(QLatin1Char('/'))) | ||
341 | srcPath += QLatin1Char('/'); | 341 | srcPath += QLatin1Char('/'); | ||
342 | if (m_dest.path().startsWith(srcPath)) { | 342 | if (m_dest.path().startsWith(srcPath)) { | ||
343 | q->setError(KIO::ERR_CANNOT_MOVE_INTO_ITSELF); | 343 | q->setError(KIO::ERR_CANNOT_MOVE_INTO_ITSELF); | ||
344 | q->emitResult(); | 344 | q->emitResult(); | ||
345 | return; | 345 | return; | ||
▲ Show 20 Lines • Show All 681 Lines • ▼ Show 20 Line(s) | 1026 | { | |||
1027 | if (m_bOverwriteAllFiles) { | 1027 | if (m_bOverwriteAllFiles) { | ||
1028 | return true; | 1028 | return true; | ||
1029 | } | 1029 | } | ||
1030 | return m_overwriteList.contains(path); | 1030 | return m_overwriteList.contains(path); | ||
1031 | } | 1031 | } | ||
1032 | 1032 | | |||
1033 | bool CopyJobPrivate::shouldSkip(const QString &path) const | 1033 | bool CopyJobPrivate::shouldSkip(const QString &path) const | ||
1034 | { | 1034 | { | ||
1035 | Q_FOREACH (const QString &skipPath, m_skipList) { | 1035 | for (const QString &skipPath : qAsConst(m_skipList)) { | ||
1036 | if (path.startsWith(skipPath)) { | 1036 | if (path.startsWith(skipPath)) { | ||
1037 | return true; | 1037 | return true; | ||
1038 | } | 1038 | } | ||
1039 | } | 1039 | } | ||
1040 | return false; | 1040 | return false; | ||
1041 | } | 1041 | } | ||
1042 | 1042 | | |||
1043 | void CopyJobPrivate::renameDirectory(const QList<CopyInfo>::iterator &it, const QUrl &newUrl) | 1043 | void CopyJobPrivate::renameDirectory(const QList<CopyInfo>::iterator &it, const QUrl &newUrl) | ||
▲ Show 20 Lines • Show All 1288 Lines • Show Last 20 Lines |