Copy local or remote files.
| 349 | |
| 350 | // Copy local or remote files. |
| 351 | bool DefaultFileAccessJobHandler::copyFile(const QString& inDest) |
| 352 | { |
| 353 | ProgressProxyExtender pp; |
| 354 | FileAccess dest; |
| 355 | dest.setFile(inDest); |
| 356 | |
| 357 | mFileAccess->setStatusText(QString()); |
| 358 | if(!mFileAccess->isNormal() || !dest.isNormal()) return false; |
| 359 | |
| 360 | qint32 permissions = (mFileAccess->isExecutable() ? 0111 : 0) + (mFileAccess->isWritable() ? 0222 : 0) + (mFileAccess->isReadable() ? 0444 : 0); |
| 361 | m_bSuccess = false; |
| 362 | KIO::FileCopyJob* pJob = KIO::file_copy(mFileAccess->url(), dest.url(), permissions, KIO::HideProgressInfo|KIO::Overwrite); |
| 363 | chk_connect(pJob, &KIO::FileCopyJob::result, this, &DefaultFileAccessJobHandler::slotSimpleJobResult); |
| 364 | chk_connect(pJob, &KIO::FileCopyJob::percentChanged, &pp, &ProgressProxyExtender::slotPercent); |
| 365 | chk_connect(pJob, &KIO::FileCopyJob::finished, this, &DefaultFileAccessJobHandler::slotJobEnded); |
| 366 | |
| 367 | ProgressProxy::enterEventLoop(pJob, |
| 368 | i18n("Copying file: %1 -> %2", mFileAccess->prettyAbsPath(), dest.prettyAbsPath())); |
| 369 | |
| 370 | return m_bSuccess; |
| 371 | // Note that the KIO-slave preserves the original date, if this is supported. |
| 372 | } |
| 373 | |
| 374 | bool DefaultFileAccessJobHandler::listDir(DirectoryList* pDirList, bool bRecursive, bool bFindHidden, const QString& filePattern, |
| 375 | const QString& fileAntiPattern, const QString& dirAntiPattern, bool bFollowDirLinks, IgnoreList& ignoreList) |
nothing calls this directly
no test coverage detected