KIO::FileCopyJob Class

Header: #include <FileCopyJob>
CMake: find_package(KF6 REQUIRED COMPONENTS KIO)
target_link_libraries(mytarget PRIVATE KF6::KIOCore)
Inherits: KIO::Job

Public Functions

QUrl destUrl() const
void setModificationTime(const QDateTime &mtime)
void setSourceSize(KIO::filesize_t size)
QUrl srcUrl() const

Signals

void mimeTypeFound(KIO::Job *job, const QString &mimeType)

Protected Slots

virtual void slotResult(KJob *job) override

Detailed Description

@class KIO::FileCopyJob filecopyjob.h <KIO/FileCopyJob>

The FileCopyJob copies data from one place to another. @see KIO::file_copy() @see KIO::file_move()

Member Function Documentation

QUrl FileCopyJob::destUrl() const

Returns the destination URL. @return the destination URL

[signal] void FileCopyJob::mimeTypeFound(KIO::Job *job, const QString &mimeType)

MIME type determined during a file copy. This is never emitted during a move, and might not be emitted during a file copy, depending on the worker. But when a get and a put are being used (which is the common case), this signal forwards the MIME type information from the get job.

@param job the job that emitted this signal @param mimeType the MIME type @since 5.78

void FileCopyJob::setModificationTime(const QDateTime &mtime)

Sets the modification time of the file

Note that this is ignored if a direct copy (WorkerBase::copy) can be done, in which case the mtime of the source is applied to the destination (if the protocol supports the concept).

void FileCopyJob::setSourceSize(KIO::filesize_t size)

If you know the size of the source file, call this method to inform this job. It will be displayed in the "resume" dialog. @param size the size of the source file

[override virtual protected slot] void FileCopyJob::slotResult(KJob *job)

Reimplements: KCompositeJob::slotResult(KJob *job).

Called whenever a subjob finishes. @param job the job that emitted this signal

QUrl FileCopyJob::srcUrl() const

Returns the source URL. @return the source URL