class Job |
|
The base class for all jobs.
For all jobs created in an application, the code looks like
KIO.Job * job = KIO.someoperation( some parameters ); connect( job, SIGNAL( result( KJob * ) ), this, SLOT( slotResult( KJob * ) ) );(other connects, specific to the job) And slotResult is usually at least:
if ( job->error() ) job->ui()->showErrorDialog(); See also KIO.Scheduler |
|
|
|
Add key/value pair to the meta data that is sent to the slave.
key - the key of the meta data value - the value of the meta data See also setMetaData() See also mergeMetaData() |
|
Add key/value pairs to the meta data that is sent to the slave.
If a certain key already existed, it will be overridden.
values - the meta data to add See also setMetaData() See also mergeMetaData() |
|
Add a job that has to be finished before a result
is emitted. This has obviously to be called before
the finish signal is emitted by the slave.
job - the subjob to add |
|
@deprecated. Don't use !
Emitted when the job is canceled.
Signal result() is emitted as well, and error() is,
in this case, ERR_USER_CANCELED.
job - the job that emitted this signal |
|
Emitted when the slave successfully connected to the host.
There is no guarantee the slave will send this, and this is
currently unused (in the applications).
job - the job that emitted this signal |
|
Converts an error code and a non-i18n error message into i18n
strings suitable for presentation in a detailed error message box.
reqUrl - the request URL that generated this error message method - the method that generated this error message (unimplemented) Returns the following strings: caption, error + description, causes+solutions |
|
Abort this job. This kills all subjobs and deletes the job. |
|
Resume this job
See also suspend |
|
Suspend this job
See also resume |
|
Converts an error code and a non-i18n error message into an
error message in the current language. The low level (non-i18n)
error message (usually a url) is put into the translated error
message using %1.
Example for errid == ERR_CANNOT_OPEN_FOR_READING: i18n( "Could not read\n%1" ).arg( errortext );Use this to display the error yourself, but for a dialog box use Job.showErrorDialog. Do not call it if error() is not 0. Returns the error message and if there is no error, a message telling the user that the app is broken, so check with error() whether there is an error |
|
Returns whether message display is enabled or disabled.
See also setInteractive .
Returns true if message display is enabled
See also setInteractive() |
|
Add key/value pairs to the meta data that is sent to the slave.
If a certain key already existed, it will remain unchanged.
values - the meta data to merge See also setMetaData() See also addMetaData() |
|
Get meta data received from the slave. (Valid when first data is received and/or slave is finished) Returns the job's meta data |
|
@internal. For the scheduler. Do not use. |
|
Returns the parent job, if there is one.
Returns the parent job, or 0 if there is none
See also setParentJob |
|
Query meta data received from the slave.
(Valid when first data is received and/or slave is finished)
key - the key of the meta data to retrieve Returns the value of the meta data, or QString() if the key does not exist |
|
Mark a sub job as being done.
KDE4 change: this doesn't terminate the parent job anymore, call emitResult to do that. job - the subjob to remove |
|
Set meta data to be sent to the slave, replacing existing
meta data.
metaData - the meta data to set See also addMetaData() See also mergeMetaData() |
|
Set the parent Job.
One example use of this is when FileCopyJob calls RenameDialog.open,
it must pass the correct progress ID of the parent CopyJob
(to hide the progress dialog).
You can set the parent job only once. By default a job does not
have a parent job.
parentJob - the new parent job |
|
Display a dialog box to inform the user of the error given by
this job.
Only call if error is not 0, and only in the slot connected
to result.
parent - the parent widget for the dialog box, can be 0 for top-level Deprecated you should use job->ui()->setWindow(parent) and job->ui()->showErrorMessage() instead |
|
|
Retrieves the UI delegate of this job.
This method is basically a convenience for static_cast Returns the delegate used by the job to communicate with the UI |