KIO::Job Class Reference
#include <jobclasses.h>
Inheritance diagram for KIO::Job:

Detailed Description
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( KIO::Job * ) ), this, SLOT( slotResult( KIO::Job * ) ) );
And slotResult is usually at least:
if ( job->error() ) job->showErrorDialog( this or 0L );
- See also:
- KIO::Scheduler
Definition at line 68 of file jobclasses.h.
Signals | |
void | result (KIO::Job *job) |
void | canceled (KIO::Job *job) |
void | infoMessage (KIO::Job *job, const QString &msg) |
void | warning (KIO::Job *job, const QString &msg) |
void | connected (KIO::Job *job) |
void | percent (KIO::Job *job, unsigned long percent) |
void | totalSize (KIO::Job *job, KIO::filesize_t size) |
void | processedSize (KIO::Job *job, KIO::filesize_t size) |
void | speed (KIO::Job *job, unsigned long speed) |
Public Member Functions | |
virtual void | kill (bool quietly=true) |
int | error () const |
int | progressId () const |
const QString & | errorText () const |
QString | errorString () const |
QStringList | detailedErrorStrings (const KURL *reqUrl=0L, int method=-1) const |
void | showErrorDialog (QWidget *parent=0L) |
void | setAutoErrorHandlingEnabled (bool enable, QWidget *parentWidget=0) |
bool | isAutoErrorHandlingEnabled () const |
void | setAutoWarningHandlingEnabled (bool enable) |
bool | isAutoWarningHandlingEnabled () const |
void | setInteractive (bool enable) |
bool | isInteractive () const |
void | setWindow (QWidget *window) |
QWidget * | window () const |
void | setParentJob (Job *parentJob) |
Job * | parentJob () const |
void | setMetaData (const KIO::MetaData &metaData) |
void | addMetaData (const QString &key, const QString &value) |
void | addMetaData (const QMap< QString, QString > &values) |
void | mergeMetaData (const QMap< QString, QString > &values) |
MetaData | outgoingMetaData () const |
MetaData | metaData () const |
QString | queryMetaData (const QString &key) |
KIO::filesize_t | getProcessedSize () |
Protected Types | |
enum | { EF_TransferJobAsync = (1 << 0), EF_TransferJobNeedData = (1 << 1), EF_TransferJobDataSent = (1 << 2), EF_ListJobUnrestricted = (1 << 3) } |
Protected Slots | |
virtual void | slotResult (KIO::Job *job) |
void | slotSpeed (KIO::Job *job, unsigned long speed) |
void | slotInfoMessage (KIO::Job *job, const QString &msg) |
void | slotSpeedTimeout () |
Protected Member Functions | |
Job (bool showProgressInfo) | |
virtual void | addSubjob (Job *job, bool inheritMetaData=true) |
virtual void | removeSubjob (Job *job) |
void | removeSubjob (Job *job, bool mergeMetaData, bool emitResultIfLast) |
void | emitPercent (KIO::filesize_t processedSize, KIO::filesize_t totalSize) |
void | emitSpeed (unsigned long speed) |
void | emitResult () |
void | setProcessedSize (KIO::filesize_t size) |
int & | extraFlags () |
virtual void | virtual_hook (int id, void *data) |
Protected Attributes | |
QPtrList< Job > | subjobs |
int | m_error |
QString | m_errorText |
unsigned long | m_percent |
int | m_progressId |
QTimer * | m_speedTimer |
QGuardedPtr< QWidget > | m_window |
MetaData | m_outgoingMetaData |
MetaData | m_incomingMetaData |
Member Function Documentation
|
Add key/value pairs to the meta data that is sent to the slave. If a certain key already existed, it will be overridden.
|
|
Add key/value pair to the meta data that is sent to the slave.
|
|
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.
|
|
Don't use ! Emitted when the job is canceled. Signal result() is emitted as well, and error() is, in this case, ERR_USER_CANCELED.
|
|
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).
|
|
Converts an error code and a non-i18n error message into i18n strings suitable for presentation in a detailed error message box.
|
|
Utility function for inherited jobs. Emits the percent signal if bigger than m_percent, after calculating it from the parameters.
|
|
Utility function to emit the result signal, and suicide this job. It first tells the observer to hide the progress dialog for this job. |
|
Utility function for inherited jobs. Emits the speed signal and starts the timer for removing that info
|
|
Returns the error code, if there has been an error. Only call this method from the slot connected to result().
Definition at line 95 of file jobclasses.h. |
|
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 );
|
|
Returns the error text if there has been an error. Only call if error is not 0. This is really internal, better use errorString() or errorDialog().
Definition at line 111 of file jobclasses.h. |
|
Returns the processed size for this job.
|
|
Emitted to display information about this job, as sent by the slave. Examples of message are "Resolving host", "Connecting to host...", etc.
|
|
Returns whether automatic error handling is enabled or disabled.
|
|
Returns whether automatic warning handling is enabled or disabled. See also setAutoWarningHandlingEnabled .
|
|
Returns whether message display is enabled or disabled.
|
|
Abort this job. This kills all subjobs and deletes the job.
Reimplemented in KIO::SimpleJob. |
|
Add key/value pairs to the meta data that is sent to the slave. If a certain key already existed, it will remain unchanged.
|
|
Get meta data received from the slave. (Valid when first data is received and/or slave is finished)
|
|
Returns the parent job, if there is one.
|
|
Progress signal showing the overall progress of the job This is valid for any kind of job, and allows using a a progress bar very easily. (see KProgress). Note that this signal is not emitted for finished jobs.
|
|
Regularly emitted to show the progress of this job (current data size for transfers, entries listed).
|
|
Returns the progress id for this job.
Definition at line 101 of file jobclasses.h. |
|
Query meta data received from the slave. (Valid when first data is received and/or slave is finished)
|
|
Overloaded version of removeSubjob.
|
|
Mark a sub job as being done. If it's the last to wait on the job will emit a result - jobs with two steps might want to override slotResult in order to avoid calling this method.
|
|
Emitted when the job is finished, in any case (completed, canceled, failed. ..). Use error to know the result.
|
|
Enable or disable the automatic error handling.
When automatic error handling is enabled and an error occurs, then showErrorDialog() is called with the specified The default is false.
|
|
Enable or disable the automatic warning handling. When automatic warning handling is enabled and an error occurs, then a message box is displayed with the warning message The default is true. See also isAutoWarningHandlingEnabled , showErrorDialog
|
|
Enable or disable the message display from the job. The default is true.
Reimplemented in KIO::CopyJob. |
|
Set meta data to be sent to the slave, replacing existing meta data.
|
|
Set the parent Job. One example use of this is when FileCopyJob calls open_RenameDlg, 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.
|
|
Set the processed size, does not emit processedSize.
|
|
Associate this job with a window given by
|
|
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.
|
|
Forward signal from subjob.
|
|
Called whenever a subjob finishes. Default implementation checks for errors and propagates to parent job, then calls removeSubjob. Override if you don't want subjobs errors to be propagated.
Reimplemented in KIO::ChmodJob, KIO::TransferJob, KIO::FileCopyJob, KIO::ListJob, KIO::CopyJob, KIO::DeleteJob, KIO::MetaInfoJob, and KIO::PreviewJob. |
|
Forward signal from subjob.
|
|
Remove speed information.
|
|
Emitted to display information about the speed of this job.
|
|
Emitted when we know the size of this job (data size for transfers, number of entries for listings).
|
|
Emitted to display a warning about this job, as sent by the slave.
|
|
Returns the window this job is associated with.
|
The documentation for this class was generated from the following file: