kget
#include <transfer.h>

Public Slots | |
void | setLog (const QString &message, Transfer::LogLevel level=Log_Info) |
Signals | |
void | capabilitiesChanged () |
Public Member Functions | |
Transfer (TransferGroup *parent, TransferFactory *factory, Scheduler *scheduler, const KUrl &src, const KUrl &dest, const QDomElement *e=0) | |
virtual | ~Transfer () |
virtual QHash< KUrl, QPair < bool, int > > | availableMirrors (const KUrl &file) const |
int | averageDownloadSpeed () const |
Capabilities | capabilities () const |
void | checkShareRatio () |
void | create () |
virtual void | deinit (DeleteOptions options) |
const KUrl & | dest () const |
void | destroy (DeleteOptions options) |
virtual KUrl | directory () const |
KIO::filesize_t | downloadedSize () const |
int | downloadLimit (SpeedLimit limit) const |
int | downloadSpeed () const |
virtual int | elapsedTime () const |
TransferFactory * | factory () const |
virtual FileModel * | fileModel () |
virtual QList< KUrl > | files () const |
TransferGroup * | group () const |
TransferHandler * | handler () |
virtual void | init () |
bool | isSelected () const |
virtual bool | isStalled () const |
virtual bool | isWorking () const |
virtual void | load (const QDomElement *element) |
const QStringList | log () const |
double | maximumShareRatio () |
TransferTreeModel * | model () |
bool | operator< (const Transfer &t2) const |
int | percent () const |
virtual int | remainingTime () const |
virtual bool | repair (const KUrl &file=KUrl()) |
virtual void | save (const QDomElement &element) |
virtual void | setAvailableMirrors (const KUrl &file, const QHash< KUrl, QPair< bool, int > > &mirrors) |
virtual bool | setDirectory (const KUrl &newDirectory) |
void | setDownloadLimit (int dlLimit, SpeedLimit limit) |
void | setMaximumShareRatio (double ratio) |
void | setUploadLimit (int ulLimit, SpeedLimit limit) |
virtual Signature * | signature (const KUrl &file) |
const KUrl & | source () const |
QPixmap | statusPixmap () const |
QString | statusText () const |
KIO::filesize_t | totalSize () const |
KIO::filesize_t | uploadedSize () const |
int | uploadLimit (SpeedLimit limit) const |
int | uploadSpeed () const |
virtual Verifier * | verifier (const KUrl &file) |
![]() | |
Job (Scheduler *scheduler, JobQueue *parent) | |
virtual | ~Job () |
Error | error () const |
JobQueue * | jobQueue () |
Policy | policy () const |
virtual void | resolveError (int errorId) |
void | setError (const QString &text, const QPixmap &pixmap, ErrorType type=AutomaticRetry, int errorId=-1) |
void | setPolicy (Policy jobPolicy) |
void | setStatus (Status jobStatus) |
virtual void | start ()=0 |
Status | startStatus () const |
Status | status () const |
virtual void | stop ()=0 |
![]() | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Static Public Member Functions | |
static QPixmap | statusPixmap (Job::Status status) |
static QString | statusText (Job::Status status) |
![]() | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions | |
void | setCapabilities (Capabilities capabilities) |
virtual void | setSpeedLimits (int uploadLimit, int downloadLimit) |
void | setStatus (Job::Status jobStatus, const QString &text=QString(), const QPixmap &pix=QPixmap()) |
virtual void | setTransferChange (ChangesFlags change, bool postEvent=false) |
![]() | |
void | postJobEvent (Status) |
void | read (QDomNode *n) |
Scheduler * | scheduler () const |
void | setStartStatus (Status jobStatus) |
void | write (QDomNode *n) |
![]() | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Protected Attributes | |
KUrl | m_dest |
KIO::filesize_t | m_downloadedSize |
int | m_downloadLimit |
int | m_downloadSpeed |
bool | m_isSelected |
QStringList | m_log |
int | m_percent |
KUrl | m_source |
KIO::filesize_t | m_totalSize |
KIO::filesize_t | m_uploadedSize |
int | m_uploadLimit |
int | m_uploadSpeed |
![]() | |
JobQueue * | m_jobQueue |
Scheduler * | m_scheduler |
Additional Inherited Members | |
![]() | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
![]() | |
objectName | |
Detailed Description
Definition at line 36 of file transfer.h.
Member Typedef Documentation
typedef int Transfer::ChangesFlags |
Definition at line 100 of file transfer.h.
Member Enumeration Documentation
enum Transfer::Capability |
Enumerator | |
---|---|
Cap_SpeedLimit | |
Cap_MultipleMirrors | |
Cap_Resuming | |
Cap_Renaming | |
Cap_Moving | |
Cap_FindFilesize |
Definition at line 70 of file transfer.h.
Enumerator | |
---|---|
DeleteTemporaryFiles | |
DeleteFiles |
Definition at line 94 of file transfer.h.
enum Transfer::LogLevel |
Enumerator | |
---|---|
Log_Info | |
Log_Warning | |
Log_Error |
Definition at line 81 of file transfer.h.
enum Transfer::SpeedLimit |
Enumerator | |
---|---|
VisibleSpeedLimit | |
InvisibleSpeedLimit |
Definition at line 88 of file transfer.h.
Here we define the flags that should be shared by all the transfers.
A transfer should also be able to define additional flags, in the future.
Definition at line 47 of file transfer.h.
Constructor & Destructor Documentation
Transfer::Transfer | ( | TransferGroup * | parent, |
TransferFactory * | factory, | ||
Scheduler * | scheduler, | ||
const KUrl & | src, | ||
const KUrl & | dest, | ||
const QDomElement * | e = 0 |
||
) |
Definition at line 47 of file transfer.cpp.
|
virtual |
Definition at line 64 of file transfer.cpp.
Member Function Documentation
The mirrors that are available bool if it is used, int how many paralell connections are allowed to the mirror.
- Parameters
-
file the file for which the availableMirrors should be get
Reimplemented in Metalink, TransferMultiSegKio, and AbstractMetalink.
Definition at line 135 of file transfer.cpp.
int Transfer::averageDownloadSpeed | ( | ) | const |
Definition at line 124 of file transfer.cpp.
|
inline |
Returns the capabilities this Transfer supports.
Definition at line 111 of file transfer.h.
|
signal |
Emitted when the capabilities of the Transfer change.
void Transfer::checkShareRatio | ( | ) |
Recalculate the share ratio.
Definition at line 190 of file transfer.cpp.
void Transfer::create | ( | ) |
This functions gets called whenever a Transfer gets created.
As opposed to init(), this isn't a virtual function and is not meant to be used in transfer plugins
Definition at line 76 of file transfer.cpp.
|
inlinevirtual |
This function is called before the deletion of a Transfer In transfer plugins you can put here whatever needs to be deinitialized.
Definition at line 138 of file transfer.h.
|
inline |
Definition at line 149 of file transfer.h.
void Transfer::destroy | ( | DeleteOptions | options | ) |
This functions gets called whenever a Transfer is going to be deleted.
As opposed to deinit(), this isn't a virtual function and is not meant to be used in transfer plugins
Definition at line 86 of file transfer.cpp.
|
inlinevirtual |
- Returns
- the directory the Transfer will be stored to
Reimplemented in BTTransfer.
Definition at line 159 of file transfer.h.
|
inline |
Definition at line 170 of file transfer.h.
int Transfer::downloadLimit | ( | SpeedLimit | limit | ) | const |
- Returns
- the DownloadLimit, which is invisible in the GUI
Definition at line 176 of file transfer.cpp.
|
inline |
Definition at line 179 of file transfer.h.
|
virtual |
|
inline |
- Returns
- a pointer to the TransferFactory object
Definition at line 272 of file transfer.h.
|
inlinevirtual |
- Returns
- a pointer to the FileModel containing all files of this download
Reimplemented in BTTransfer, Metalink, TransferMultiSegKio, and AbstractMetalink.
Definition at line 277 of file transfer.h.
|
inlinevirtual |
- Returns
- all files of this transfer
Reimplemented in BTTransfer, Metalink, and AbstractMetalink.
Definition at line 154 of file transfer.h.
|
inline |
The owner group.
Definition at line 257 of file transfer.h.
TransferHandler * Transfer::handler | ( | ) |
- Returns
- the associated TransferHandler
Definition at line 217 of file transfer.cpp.
|
virtual |
This function is called after the creation of a Transfer In transfer plugins you can put here whatever needs to be initialized.
- Note
- this function creates a NepomukHandler
Reimplemented in TransferMultiSegKio.
Definition at line 95 of file transfer.cpp.
|
inline |
Definition at line 242 of file transfer.h.
|
inlinevirtual |
|
inlinevirtual |
|
virtual |
Loads the transfer's info from the QDomElement.
- Parameters
-
element The pointer to the QDomNode where info will be loaded from
Reimplemented in BTTransfer, MetalinkXml, and Metalink.
Definition at line 244 of file transfer.cpp.
const QStringList Transfer::log | ( | ) | const |
Transfer history.
|
inline |
- Returns
- the maximum share-ratio
Definition at line 235 of file transfer.h.
TransferTreeModel * Transfer::model | ( | ) |
- Returns
- the TransferTreeModel that owns this group
Definition at line 225 of file transfer.cpp.
bool Transfer::operator< | ( | const Transfer & | t2 | ) | const |
Defines the order between transfers.
|
inline |
Definition at line 178 of file transfer.h.
|
inlinevirtual |
Implements Job.
Reimplemented in BTTransfer, Metalink, and AbstractMetalink.
Definition at line 182 of file transfer.h.
|
inlinevirtual |
Tries to repair file.
- Parameters
-
file the file of a download that should be repaired, if not defined all files of a download are going to be repaird
- Returns
- true if a repair started, false if it was not nescessary
Reimplemented in TransferKio, Metalink, TransferMultiSegKio, and AbstractMetalink.
Definition at line 146 of file transfer.h.
|
virtual |
Saves this transfer to the given QDomNode.
- Parameters
-
element The pointer to the QDomNode where the transfer will be saved
Reimplemented in MetalinkXml, and Metalink.
Definition at line 230 of file transfer.cpp.
|
inlinevirtual |
Set the mirrors, int the number of paralell connections to the mirror bool if the mirror should be used.
- Parameters
-
file the file for which the availableMirrors should be set
Reimplemented in Metalink, TransferMultiSegKio, and AbstractMetalink.
Definition at line 200 of file transfer.h.
|
protected |
Sets the capabilities and automatically emits capabilitiesChanged.
Definition at line 68 of file transfer.cpp.
|
virtual |
Move the download to the new destination.
- Parameters
-
newDirectory is a directory where the download should be stored
- Returns
- true if newDestination can be used
Reimplemented in BTTransfer, Metalink, TransferMultiSegKio, TransferKio, and AbstractMetalink.
Definition at line 108 of file transfer.cpp.
void Transfer::setDownloadLimit | ( | int | dlLimit, |
SpeedLimit | limit | ||
) |
Set the Transfer's UploadLimit, which are displayed in the GUI.
- Note
- this is not displayed in any GUI, use setVisibleDownloadLimit(int) instead
- Parameters
-
visibleUlLimit upload Limit
Definition at line 156 of file transfer.cpp.
|
slot |
Set Transfer history.
Definition at line 201 of file transfer.cpp.
void Transfer::setMaximumShareRatio | ( | double | ratio | ) |
Set the maximum share-ratio.
- Parameters
-
ratio the new maximum share-ratio
Definition at line 184 of file transfer.cpp.
|
inlineprotectedvirtual |
Function used to set the SpeedLimits to the transfer.
Reimplemented in BTTransfer.
Definition at line 353 of file transfer.h.
|
protected |
Sets the Job status to jobStatus, the status text to text and the status pixmap to pix.
It's important to call job::setStatus AFTER having changed the icon or the text or whatever. This because this function also notifies about this change the scheduler which could also decide to change it another time as well. For example if a job status is set to Aborted, the scheduler could mark it to Delayed. This could trigger another icon or text change which would be the right one since the status of the Job has changed. If we set the icon or text after calling setStatus(), we can overwrite the last icon or text change.
Definition at line 292 of file transfer.cpp.
|
protectedvirtual |
Makes the TransferHandler associated with this transfer know that a change in this transfer has occurred.
- Parameters
-
change the TransferChange flags to be set
Definition at line 338 of file transfer.cpp.
void Transfer::setUploadLimit | ( | int | ulLimit, |
SpeedLimit | limit | ||
) |
Set the Transfer's UploadLimit.
- Note
- this is not displayed in any GUI, use setVisibleUploadLimit(int) instead
- Parameters
-
visibleUlLimit upload Limit
Definition at line 144 of file transfer.cpp.
|
inlinevirtual |
- Parameters
-
file for which to get the signature
- Returns
- Signature that allows you to add signatures and verify them
Reimplemented in Metalink, TransferMultiSegKio, AbstractMetalink, and TransferKio.
Definition at line 289 of file transfer.h.
|
inline |
Definition at line 148 of file transfer.h.
|
inline |
Definition at line 173 of file transfer.h.
|
static |
Definition at line 351 of file transfer.cpp.
|
inline |
Definition at line 172 of file transfer.h.
|
static |
Definition at line 346 of file transfer.cpp.
|
inline |
Definition at line 169 of file transfer.h.
|
inline |
Definition at line 171 of file transfer.h.
int Transfer::uploadLimit | ( | SpeedLimit | limit | ) | const |
- Returns
- the UploadLimit, which is invisible in the GUI
Definition at line 168 of file transfer.cpp.
|
inline |
Definition at line 181 of file transfer.h.
|
inlinevirtual |
- Parameters
-
file for which to get the verifier
- Returns
- Verifier that allows you to add checksums manually verify a file etc.
Reimplemented in Metalink, TransferMultiSegKio, AbstractMetalink, and TransferKio.
Definition at line 283 of file transfer.h.
Member Data Documentation
|
protected |
Definition at line 357 of file transfer.h.
|
protected |
Definition at line 361 of file transfer.h.
|
protected |
Definition at line 368 of file transfer.h.
|
protected |
Definition at line 364 of file transfer.h.
|
protected |
Definition at line 370 of file transfer.h.
|
protected |
Definition at line 359 of file transfer.h.
|
protected |
Definition at line 363 of file transfer.h.
|
protected |
Definition at line 356 of file transfer.h.
|
protected |
Definition at line 360 of file transfer.h.
|
protected |
Definition at line 362 of file transfer.h.
|
protected |
Definition at line 367 of file transfer.h.
|
protected |
Definition at line 365 of file transfer.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:28:44 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.