KIO
KIO::CopyJob Class Reference
CopyJob is used to move, copy or symlink files and directories. More...
#include <copyjob.h>

Public Types | |
enum | CopyMode { Copy, Move, Link } |
Signals | |
void | aboutToCreate (KIO::Job *job, const QList< KIO::CopyInfo > &files) |
void | copying (KIO::Job *job, const KUrl &src, const KUrl &dest) |
void | copyingDone (KIO::Job *job, const KUrl &from, const KUrl &to, time_t mtime, bool directory, bool renamed) |
void | copyingLinkDone (KIO::Job *job, const KUrl &from, const QString &target, const KUrl &to) |
void | creatingDir (KIO::Job *job, const KUrl &dir) |
void | linking (KIO::Job *job, const QString &target, const KUrl &to) |
void | moving (KIO::Job *job, const KUrl &from, const KUrl &to) |
void | processedDirs (KIO::Job *job, unsigned long dirs) |
void | processedFiles (KIO::Job *job, unsigned long files) |
void | renamed (KIO::Job *job, const KUrl &from, const KUrl &to) |
void | totalDirs (KJob *job, unsigned long dirs) |
void | totalFiles (KJob *job, unsigned long files) |
Public Member Functions | |
KUrl | destUrl () const |
virtual bool | doSuspend () |
CopyMode | operationMode () const |
void | setAutoSkip (bool autoSkip) |
void | setDefaultPermissions (bool b) |
void | setWriteIntoExistingDirectories (bool overwriteAllDirs) |
KUrl::List | srcUrls () const |
virtual | ~CopyJob () |
Protected Slots | |
virtual void | slotResult (KJob *job) |
Protected Member Functions | |
CopyJob (CopyJobPrivate &dd) |
Detailed Description
CopyJob is used to move, copy or symlink files and directories.Don't create the job directly, but use KIO::copy(), KIO::move(), KIO::link() and friends.
Definition at line 65 of file copyjob.h.
Member Enumeration Documentation
Constructor & Destructor Documentation
CopyJob::~CopyJob | ( | ) | [virtual] |
Definition at line 238 of file copyjob.cpp.
CopyJob::CopyJob | ( | CopyJobPrivate & | dd | ) | [protected] |
Definition at line 232 of file copyjob.cpp.
Member Function Documentation
void KIO::CopyJob::aboutToCreate | ( | KIO::Job * | job, | |
const QList< KIO::CopyInfo > & | files | |||
) | [signal] |
Emitted when it is known which files / directories are going to be created.
Note that this may still change e.g. when existing files with the same name are discovered.
- Parameters:
-
job the job that emitted this signal files a list of items that are about to be created.
void KIO::CopyJob::copying | ( | KIO::Job * | job, | |
const KUrl & | src, | |||
const KUrl & | dest | |||
) | [signal] |
The job is copying a file or directory.
Note: This signal is used for progress dialogs, it's not emitted for every file or directory (this would be too slow), but every 200ms.
- Parameters:
-
job the job that emitted this signal src the URL of the file or directory that is currently being copied dest the destination of the current operation
void KIO::CopyJob::copyingDone | ( | KIO::Job * | job, | |
const KUrl & | from, | |||
const KUrl & | to, | |||
time_t | mtime, | |||
bool | directory, | |||
bool | renamed | |||
) | [signal] |
The job emits this signal when copying or moving a file or directory successfully finished.
This signal is mainly for the Undo feature. If you simply want to know when a copy job is done, use result().
- Parameters:
-
job the job that emitted this signal from the source URL to the destination URL mtime the modification time of the source file, hopefully set on the destination file too (when the kioslave supports it). directory indicates whether a file or directory was successfully copied/moved. true for a directory, false for file renamed indicates that the destination URL was created using a rename operation (i.e. fast directory moving). true if is has been renamed
void KIO::CopyJob::copyingLinkDone | ( | KIO::Job * | job, | |
const KUrl & | from, | |||
const QString & | target, | |||
const KUrl & | to | |||
) | [signal] |
The job is copying or moving a symbolic link, that points to target.
The new link is created in to
. The existing one is/was in from
. This signal is mainly for the Undo feature.
- Parameters:
-
job the job that emitted this signal from the source URL target the target to the destination URL
void KIO::CopyJob::creatingDir | ( | KIO::Job * | job, | |
const KUrl & | dir | |||
) | [signal] |
The job is creating the directory dir
.
This signal is emitted for every directory being created.
- Parameters:
-
job the job that emitted this signal dir the directory that is currently being created
KUrl CopyJob::destUrl | ( | ) | const |
Returns the destination URL.
- Returns:
- the destination URL
Definition at line 247 of file copyjob.cpp.
bool CopyJob::doSuspend | ( | ) | [virtual] |
Reimplemented for internal reasons.
Reimplemented from KIO::Job.
Definition at line 426 of file copyjob.cpp.
The job is creating a symbolic link.
Note: This signal is used for progress dialogs, it's not emitted for every file or directory (this would be too slow), but every 200ms.
- Parameters:
-
job the job that emitted this signal target the URL of the file or directory that is currently being linked to the destination of the current operation
void KIO::CopyJob::moving | ( | KIO::Job * | job, | |
const KUrl & | from, | |||
const KUrl & | to | |||
) | [signal] |
The job is moving a file or directory.
Note: This signal is used for progress dialogs, it's not emitted for every file or directory (this would be too slow), but every 200ms.
- Parameters:
-
job the job that emitted this signal from the URL of the file or directory that is currently being moved to the destination of the current operation
KIO::CopyJob::CopyMode KIO::CopyJob::operationMode | ( | ) | const |
Returns the mode of the operation (copy, move, or link), depending on whether KIO::copy(), KIO::move() or KIO::link() was called.
Definition at line 1868 of file copyjob.cpp.
void KIO::CopyJob::processedDirs | ( | KIO::Job * | job, | |
unsigned long | dirs | |||
) | [signal] |
Sends the number of processed directories.
- Parameters:
-
job the job that emitted this signal dirs the number of processed dirs
void KIO::CopyJob::processedFiles | ( | KIO::Job * | job, | |
unsigned long | files | |||
) | [signal] |
Sends the number of processed files.
- Parameters:
-
job the job that emitted this signal files the number of processed files
void KIO::CopyJob::renamed | ( | KIO::Job * | job, | |
const KUrl & | from, | |||
const KUrl & | to | |||
) | [signal] |
The user chose to rename from
to to
.
- Parameters:
-
job the job that emitted this signal from the original name to the new name
void KIO::CopyJob::setAutoSkip | ( | bool | autoSkip | ) |
Skip copying or moving any file when the destination already exists, instead of the default behavior (interactive mode: showing a dialog to the user, non-interactive mode: aborting with an error).
Initially added for a unit test.
- Since:
- 4.2
Definition at line 1873 of file copyjob.cpp.
void KIO::CopyJob::setDefaultPermissions | ( | bool | b | ) |
By default the permissions of the copied files will be those of the source files.
But when copying "template" files to "new" files, people prefer the umask to apply, rather than the template's permissions. For that case, call setDefaultPermissions(true)
Definition at line 1863 of file copyjob.cpp.
void KIO::CopyJob::setWriteIntoExistingDirectories | ( | bool | overwriteAllDirs | ) |
Reuse any directory that already exists, instead of the default behavior (interactive mode: showing a dialog to the user, non-interactive mode: aborting with an error).
- Since:
- 4.2
Definition at line 1879 of file copyjob.cpp.
void CopyJob::slotResult | ( | KJob * | job | ) | [protected, virtual, slot] |
Definition at line 1808 of file copyjob.cpp.
KUrl::List CopyJob::srcUrls | ( | ) | const |
Returns the list of source URLs.
- Returns:
- the list of source URLs.
Definition at line 242 of file copyjob.cpp.
void KIO::CopyJob::totalDirs | ( | KJob * | job, | |
unsigned long | dirs | |||
) | [signal] |
Emitted when the toal number of direcotries is known.
- Parameters:
-
job the job that emitted this signal dirs the total number of directories
void KIO::CopyJob::totalFiles | ( | KJob * | job, | |
unsigned long | files | |||
) | [signal] |
Emitted when the total number of files is known.
- Parameters:
-
job the job that emitted this signal files the total number of files
The documentation for this class was generated from the following files: