KIO
#include <jobclasses.h>
Signals | |
void | canceled (KJob *job) |
void | connected (KIO::Job *job) |
Signals inherited from KCompositeJob | |
void | description (KJob *job, const QString &title, const QPair< QString, QString > &field1=qMakePair(QString(), QString()), const QPair< QString, QString > &field2=qMakePair(QString(), QString())) |
void | finished (KJob *job) |
void | infoMessage (KJob *job, const QString &plain, const QString &rich=QString()) |
void | percent (KJob *job, unsigned long percent) |
void | processedAmount (KJob *job, KJob::Unit unit, qulonglong amount) |
void | processedSize (KJob *job, qulonglong size) |
void | result (KJob *job) |
void | resumed (KJob *job) |
void | speed (KJob *job, unsigned long speed) |
void | suspended (KJob *job) |
void | totalAmount (KJob *job, KJob::Unit unit, qulonglong amount) |
void | totalSize (KJob *job, qulonglong size) |
void | warning (KJob *job, const QString &plain, const QString &rich=QString()) |
Public Member Functions | |
virtual | ~Job () |
void | addMetaData (const QString &key, const QString &value) |
void | addMetaData (const QMap< QString, QString > &values) |
QStringList | detailedErrorStrings (const KUrl *reqUrl=0L, int method=-1) const |
QString | errorString () const |
bool | isInteractive () const |
void | mergeMetaData (const QMap< QString, QString > &values) |
MetaData | metaData () const |
MetaData | outgoingMetaData () const |
Job * | parentJob () const |
QString | queryMetaData (const QString &key) |
void | setMetaData (const KIO::MetaData &metaData) |
void | setParentJob (Job *parentJob) |
void | showErrorDialog (QWidget *parent=0) |
void | start () |
JobUiDelegate * | ui () const |
Public Member Functions inherited from KCompositeJob | |
KCompositeJob (QObject *parent=0) | |
virtual | ~KCompositeJob () |
virtual | ~KJob () |
Capabilities | capabilities () const |
int | error () const |
QString | errorText () const |
bool | exec () |
bool | isAutoDelete () const |
bool | isSuspended () const |
KJob (QObject *parent=0) | |
unsigned long | percent () const |
qulonglong | processedAmount (Unit unit) const |
void | setAutoDelete (bool autodelete) |
void | setUiDelegate (KJobUiDelegate *delegate) |
qulonglong | totalAmount (Unit unit) const |
KJobUiDelegate * | uiDelegate () const |
Protected Member Functions | |
Job () | |
Job (JobPrivate &dd) | |
virtual bool | addSubjob (KJob *job) |
virtual bool | doKill () |
virtual bool | doResume () |
virtual bool | doSuspend () |
virtual bool | removeSubjob (KJob *job) |
Protected Member Functions inherited from KCompositeJob | |
KCompositeJob (KCompositeJobPrivate &dd, QObject *parent) | |
void | clearSubjobs () |
void | emitPercent (qulonglong processedAmount, qulonglong totalAmount) |
void | emitResult () |
void | emitSpeed (unsigned long speed) |
bool | hasSubjobs () |
KJob (KJobPrivate &dd, QObject *parent) | |
void | setCapabilities (Capabilities capabilities) |
void | setError (int errorCode) |
void | setErrorText (const QString &errorText) |
void | setPercent (unsigned long percentage) |
void | setProcessedAmount (Unit unit, qulonglong amount) |
void | setTotalAmount (Unit unit, qulonglong amount) |
const QList< KJob * > & | subjobs () const |
Additional Inherited Members | |
Public Types inherited from KCompositeJob | |
enum | Capability |
enum | KillVerbosity |
enum | Unit |
Public Slots inherited from KCompositeJob | |
bool | kill (KillVerbosity verbosity=Quietly) |
bool | resume () |
bool | suspend () |
Protected Slots inherited from KCompositeJob | |
virtual void | slotInfoMessage (KJob *job, const QString &plain, const QString &rich) |
virtual void | slotResult (KJob *job) |
Protected Attributes inherited from KCompositeJob | |
KJobPrivate *const | d_ptr |
Detailed Description
The base class for all jobs.
For all jobs created in an application, the code looks like
(other connects, specific to the job)
And slotResult is usually at least:
- See also
- KIO::Scheduler
Definition at line 94 of file jobclasses.h.
Constructor & Destructor Documentation
|
protected |
Member Function Documentation
Add key/value pair to the meta data that is sent to the slave.
- Parameters
-
key the key of the meta data value the value of the meta data
- See also
- setMetaData()
- 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.
- Parameters
-
values the meta data to add
- See also
- setMetaData()
- 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.
- Parameters
-
job the subjob to add
Reimplemented from KCompositeJob.
|
signal |
- 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.
- Parameters
-
job the job that emitted this signal
|
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).
- Parameters
-
job the job that emitted this signal
QStringList KIO::Job::detailedErrorStrings | ( | const KUrl * | reqUrl = 0L , |
int | method = -1 |
||
) | const |
Converts an error code and a non-i18n error message into i18n strings suitable for presentation in a detailed error message box.
- Parameters
-
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
Definition at line 419 of file global.cpp.
|
protectedvirtual |
Abort this job.
This kills all subjobs and deletes the job.
Reimplemented from KCompositeJob.
Reimplemented in KIO::SimpleJob.
|
protectedvirtual |
Resume this job.
- See also
- suspend
Reimplemented from KCompositeJob.
Reimplemented in KIO::FileCopyJob, KIO::TransferJob, and KIO::SimpleJob.
|
protectedvirtual |
Suspend this job.
- See also
- resume
Reimplemented from KCompositeJob.
Reimplemented in KIO::FileCopyJob, KIO::SimpleJob, and KIO::CopyJob.
|
virtual |
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:
Use this to display the error yourself, but for a dialog box use ui()->showErrorMessage(). 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
Reimplemented from KCompositeJob.
Definition at line 159 of file global.cpp.
bool Job::isInteractive | ( | ) | const |
Returns whether the user should be asked about things when the job is unsure, like whether to overwrite existing files etc.
- Returns
- true if user interactions are enabled (true by default), false if setUiDelegate(0) was called.
- See also
- setUiDelegate()
Add key/value pairs to the meta data that is sent to the slave.
If a certain key already existed, it will remain unchanged.
- Parameters
-
values the meta data to merge
- See also
- setMetaData()
- addMetaData()
MetaData Job::metaData | ( | ) | const |
MetaData Job::outgoingMetaData | ( | ) | const |
Job * Job::parentJob | ( | ) | const |
Returns the parent job, if there is one.
- Returns
- the parent job, or 0 if there is none
- See also
- setParentJob
Mark a sub job as being done.
KDE4 change: this doesn't terminate the parent job anymore, call emitResult to do that.
- Parameters
-
job the subjob to remove
Reimplemented from KCompositeJob.
void Job::setMetaData | ( | const KIO::MetaData & | metaData | ) |
Set meta data to be sent to the slave, replacing existing meta data.
- Parameters
-
metaData the meta data to set
- See also
- addMetaData()
- mergeMetaData()
void Job::setParentJob | ( | Job * | parentJob | ) |
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.
- Parameters
-
parentJob the new parent job
void Job::showErrorDialog | ( | QWidget * | parent = 0 | ) |
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.
- Parameters
-
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
|
inlinevirtual |
Implements KCompositeJob.
Definition at line 103 of file jobclasses.h.
JobUiDelegate * Job::ui | ( | ) | const |
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:04 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.