• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KIO

KIO::TransferJob

KIO::TransferJob Class Reference

The transfer job pumps data into and/or out of a Slave. More...

#include <jobclasses.h>

Inheritance diagram for KIO::TransferJob:
KIO::SimpleJob KIO::Job KCompositeJob KJob QObject KIO::DavJob KIO::MimetypeJob KIO::MultiGetJob KIO::SpecialJob KIO::StoredTransferJob

List of all members.

Signals

void canResume (KIO::Job *job, KIO::filesize_t offset)
void data (KIO::Job *job, const QByteArray &data)
void dataReq (KIO::Job *job, QByteArray &data)
void mimetype (KIO::Job *job, const QString &type)
void permanentRedirection (KIO::Job *job, const KUrl &fromUrl, const KUrl &toUrl)
void redirection (KIO::Job *job, const KUrl &url)

Public Member Functions

bool isErrorPage () const
QString mimetype () const
KDE_DEPRECATED bool reportDataSent () const
void sendAsyncData (const QByteArray &data)
void setAsyncDataEnabled (bool enabled)
void setModificationTime (const QDateTime &mtime)
KDE_DEPRECATED void setReportDataSent (bool enabled)
void setTotalSize (KIO::filesize_t bytes)
 ~TransferJob ()

Protected Slots

virtual void slotData (const QByteArray &data)
virtual void slotDataReq ()
virtual void slotFinished ()
virtual void slotMetaData (const KIO::MetaData &_metaData)
virtual void slotMimetype (const QString &mimetype)
virtual void slotRedirection (const KUrl &url)

Protected Member Functions

virtual bool doResume ()
virtual void slotResult (KJob *job)
 TransferJob (TransferJobPrivate &dd)

Detailed Description

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.

Definition at line 509 of file jobclasses.h.


Constructor & Destructor Documentation

TransferJob::~TransferJob (  ) 

Definition at line 894 of file job.cpp.

TransferJob::TransferJob ( TransferJobPrivate &  dd  )  [protected]

Definition at line 885 of file job.cpp.


Member Function Documentation

void KIO::TransferJob::canResume ( KIO::Job *  job,
KIO::filesize_t  offset 
) [signal]

For internal use only.

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)

void KIO::TransferJob::data ( KIO::Job *  job,
const QByteArray &  data 
) [signal]

Data from the slave has arrived.

Parameters:
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.

void KIO::TransferJob::dataReq ( KIO::Job *  job,
QByteArray &  data 
) [signal]

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)

Parameters:
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)
bool TransferJob::doResume (  )  [protected, virtual]

Reimplemented for internal reasons.

Reimplemented from KIO::SimpleJob.

Definition at line 1111 of file job.cpp.

bool TransferJob::isErrorPage (  )  const

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.

Definition at line 1121 of file job.cpp.

void KIO::TransferJob::mimetype ( KIO::Job *  job,
const QString &  type 
) [signal]

Mimetype determined.

Parameters:
job the job that emitted this signal
type the mime type
QString TransferJob::mimetype (  )  const

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

Returns:
the mimetype of the URL

Definition at line 1044 of file job.cpp.

void KIO::TransferJob::permanentRedirection ( KIO::Job *  job,
const KUrl &  fromUrl,
const KUrl &  toUrl 
) [signal]

Signals a permanent redirection.

The redirection itself is handled internally.

Parameters:
job the job that emitted this signal
fromUrl the original URL
toUrl the new URL
void KIO::TransferJob::redirection ( KIO::Job *  job,
const KUrl &  url 
) [signal]

Signals a redirection.

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

Parameters:
job the job that emitted this signal
url the new URL
bool TransferJob::reportDataSent (  )  const

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).

Deprecated:
not needed, this is false for KIO::get and true for KIO::put, automatically since KDE-4.2.1 (and not useful as public API)

Definition at line 1039 of file job.cpp.

void TransferJob::sendAsyncData ( const QByteArray &  data  ) 

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.

Definition at line 1014 of file job.cpp.

void TransferJob::setAsyncDataEnabled ( bool  enabled  ) 

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.

Definition at line 1005 of file job.cpp.

void TransferJob::setModificationTime ( const QDateTime &  mtime  ) 

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

Definition at line 1216 of file job.cpp.

void TransferJob::setReportDataSent ( bool  enabled  ) 

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
slotSpeed
Deprecated:
not needed, this is false for KIO::get and true for KIO::put, automatically since KDE-4.2.1

Definition at line 1030 of file job.cpp.

void KIO::TransferJob::setTotalSize ( KIO::filesize_t  bytes  ) 

Set the total size of data that we are going to send in a put job.

Helps getting proper progress information.

Since:
4.2.1

Definition at line 906 of file job.cpp.

void TransferJob::slotData ( const QByteArray &  data  )  [protected, virtual, slot]

Reimplemented in KIO::DavJob, and KIO::MultiGetJob.

Definition at line 899 of file job.cpp.

void TransferJob::slotDataReq (  )  [protected, virtual, slot]

Definition at line 1051 of file job.cpp.

void TransferJob::slotFinished (  )  [protected, virtual, slot]

Called when the slave marks the job as finished.

Reimplemented from KIO::SimpleJob.

Reimplemented in KIO::DavJob, KIO::MultiGetJob, and KIO::MimetypeJob.

Definition at line 943 of file job.cpp.

void TransferJob::slotMetaData ( const KIO::MetaData &  _metaData  )  [protected, virtual, slot]

MetaData from the slave is received.

Parameters:
_metaData the meta data
See also:
metaData()

Reimplemented from KIO::SimpleJob.

Definition at line 1183 of file job.cpp.

void TransferJob::slotMimetype ( const QString &  mimetype  )  [protected, virtual, slot]

Reimplemented in KIO::MultiGetJob.

Definition at line 1089 of file job.cpp.

void TransferJob::slotRedirection ( const KUrl &  url  )  [protected, virtual, slot]

Reimplemented in KIO::MultiGetJob.

Definition at line 912 of file job.cpp.

void TransferJob::slotResult ( KJob *  job  )  [protected, virtual]

Called when m_subJob finishes.

Parameters:
job the job that finished

Reimplemented from KCompositeJob.

Definition at line 1201 of file job.cpp.


The documentation for this class was generated from the following files:
  • jobclasses.h
  • job.cpp

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal