# class TransferJob

###

Module | kio
Namespace | KIO
Class | TransferJob
Inherits | KIO::SimpleJob

The transfer job pumps data into and/or out of a Slave. Data is sent to the slave on request of the slave ( dataReq). If data coming from the slave can not be handled, the reading of data from the slave should be suspended.

### methods

- TransferJob (dd)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  dd | TransferJobPrivate |

- TransferJob ( )

  returns ctor
  Not implemented
  before KDE 4.1.0 only

- canResume (job, offset)

  returns Nothing
  SIGNAL ("canResume (Job*, filesize_t)")

  Argument | Type | Default
  --- | --- | ---
  job | KIO.Job |
  offset | KIO.filesize_t |

  Internal Emitted if the "put" job found an existing partial file (in which case offset is the size of that file) and emitted by the "get" job if it supports resuming to the given offset - in this case offset is unused)

- data (job, data)

  returns Nothing
  SIGNAL ("data (Job*, const QByteArray&)")

  Argument | Type | Default
  --- | --- | ---
  job | KIO.Job |
  data | QByteArray |

  Data from the slave has arrived.

  job - the job that emitted this signal

  data - data received from the slave.

  End of data (EOD) has been reached if data.size() == 0, however, you should not be certain of data.size() == 0 ever happening (e.g. in case of an error), so you should rely on result() instead.

- dataReq (job, data)

  returns Nothing
  SIGNAL ("dataReq (Job*, QByteArray&)")

  Argument | Type | Default
  --- | --- | ---
  job | KIO.Job |
  data | QByteArray |

  Request for data. Please note, that you shouldn't put too large chunks of data in it as this requires copies within the frame work, so you should rather split the data you want to pass here in reasonable chunks (about 1MB maximum)

  job - the job that emitted this signal

  data - buffer to fill with data to send to the slave. An empty buffer indicates end of data. (EOD)

- doResume ( )

  returns bool

  Reimplemented for internal reasons

- isErrorPage ( )

  returns bool

  Checks whether we got an error page. This currently only happens with HTTP urls. Call this from your slot connected to result().

  Returns true if we got an (HTML) error page from the server instead of what we asked for.

- mimetype ( )

  returns QString

  Call this in the slot connected to result, and only after making sure no error happened. Returns the mimetype of the URL

- mimetype (job, type)

  returns Nothing
  SIGNAL ("mimetype (Job*, const QString&)")

  Argument | Type | Default
  --- | --- | ---
  job | KIO.Job |
  type | QString |

  Mimetype determined.

  job - the job that emitted this signal

  type - the mime type

- permanentRedirection (job, fromUrl, toUrl)

  returns Nothing
  SIGNAL ("permanentRedirection (Job*, const KUrl&, const KUrl&)")

  Argument | Type | Default
  --- | --- | ---
  job | KIO.Job |
  fromUrl | KUrl |
  toUrl | KUrl |

  Signals a permanent redirection. The redirection itself is handled internally.

  job - the job that emitted this signal

  fromUrl - the original URL

  toUrl - the new URL

- redirection (job, url)

  returns Nothing
  SIGNAL ("redirection (Job*, const KUrl&)")

  Argument | Type | Default
  --- | --- | ---
  job | KIO.Job |
  url | KUrl |

  Signals a redirection. Use to update the URL shown to the user. The redirection itself is handled internally.

  job - the job that emitted this signal

  url - the new URL

- reportDataSent ( )

  returns bool

  Returns whether the job reports the amount of data that has been sent (true), or whether the job reports the amount of data that has been received (false)

- sendAsyncData (data)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  data | QByteArray |

  Provide data to the job when async data is enabled. Should be called exactly once after receiving a dataReq signal Sending an empty block indicates end of data.

- setAsyncDataEnabled (enabled)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  enabled | bool |

  Enable the async data mode. When async data is enabled, data should be provided to the job by calling sendAsyncData() instead of returning data in the dataReq() signal.

- setModificationTime (mtime)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  mtime | QDateTime |

  Sets the modification time of the file to be created (by KIO.put) Note that some kioslaves might ignore this.

- setReportDataSent (enabled)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  enabled | bool |

  When enabled, the job reports the amount of data that has been sent, instead of the amount of data that that has been received.

  See also slotProcessedSize

  See also slotSpeed

- slotData (data)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  data | QByteArray |

- slotDataReq ( )

  returns Nothing

- slotFinished ( )

  returns Nothing

- slotMetaData (_metaData)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  _metaData | KIO.MetaData |

- slotMimetype (mimetype)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  mimetype | QString |

- slotRedirection (url)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  url | KUrl |

- slotResult (job)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  job | KJob |

  Called when m_subJob finishes.

  job - the job that finished