kget
#include <datasourcefactory.h>

Public Slots | |
void | load (const QDomElement *e) |
void | save (const QDomElement &element) |
Signals | |
void | capabilitiesChanged () |
void | dataSourceFactoryChange (Transfer::ChangesFlags change) |
void | log (const QString &message, Transfer::LogLevel logLevel) |
Public Member Functions | |
DataSourceFactory (QObject *parent, const KUrl &dest=KUrl(), KIO::filesize_t size=0, KIO::fileoffset_t segSize=512000) | |
~DataSourceFactory () | |
void | addMirror (const KUrl &url, bool used, int numParalellConnections=1) |
void | addMirror (const KUrl &url, int numParalellConnections=1) |
Transfer::Capabilities | capabilities () const |
ulong | currentSpeed () const |
void | deinit () |
KUrl | dest () const |
bool | doDownload () const |
KIO::filesize_t | downloadedSize () const |
bool | downloadInitialized () const |
bool | isValid () const |
int | maxMirrorsUsed () const |
QHash< KUrl, QPair< bool, int > > | mirrors () const |
ulong | percent () const |
void | removeMirror (const KUrl &url) |
void | repair () |
void | setDoDownload (bool doDownload) |
void | setMaxMirrorsUsed (int maxMirrorsUsed) |
void | setMirrors (const QHash< KUrl, QPair< bool, int > > &mirrors) |
bool | setNewDestination (const KUrl &newDest) |
Signature * | signature () |
KIO::filesize_t | size () const |
void | start () |
Job::Status | status () const |
void | stop () |
Verifier * | verifier () |
![]() | |
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 |
Additional Inherited Members | |
![]() | |
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) |
![]() | |
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) |
![]() | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
![]() | |
objectName | |
Detailed Description
This class manages multiple DataSources and saves the received data to the file.
Definition at line 38 of file datasourcefactory.h.
Constructor & Destructor Documentation
|
explicit |
In general use this constructor, if the size is 0, the datasourcefactory will try to find the filesize.
- Note
- when you want to load a datasourcefactory you do not have to specify the url and segSize
Definition at line 39 of file datasourcefactory.cpp.
DataSourceFactory::~DataSourceFactory | ( | ) |
Definition at line 75 of file datasourcefactory.cpp.
Member Function Documentation
void DataSourceFactory::addMirror | ( | const KUrl & | url, |
bool | used, | ||
int | numParalellConnections = 1 |
||
) |
Add a mirror that can be used for downloading.
- Parameters
-
url the url to the file used defines whether the mirror should initially be used for downloading or not, if true m_maxMirrorsUsed might be increased if needed numParalellConnections the number of simultanous connections allowed to that mirror, minimum is 1
- Note
- when you add an already existing mirror only the numParalellConnections are adapted to the new value, so to change the number of paralell connections of a mirror you are already using simply call addMirror again
Definition at line 378 of file datasourcefactory.cpp.
void DataSourceFactory::addMirror | ( | const KUrl & | url, |
int | numParalellConnections = 1 |
||
) |
Add a mirror that can be used for downloading, if it will be used depends if maxMirrorsUsed has been reached yet.
- Parameters
-
url the url to the file numParalellConnections the number of simultanous connections allowed to that mirror, minimum is 1
- Note
- when you add an already existing mirror only the numParalellConnections are adapted to the new value, so to change the number of paralell connections of a mirror you are already using simply call addMirror again
Definition at line 373 of file datasourcefactory.cpp.
|
inline |
The capabilities the DataSourceFactory supports.
Definition at line 55 of file datasourcefactory.h.
|
signal |
|
inline |
Definition at line 73 of file datasourcefactory.h.
|
signal |
void DataSourceFactory::deinit | ( | ) |
Deletes the created (downloadInitialized() is true) file if the download was not finished Does not delete anything if the download never got started.
- See also
- downloadInitialized()
Definition at line 112 of file datasourcefactory.cpp.
|
inline |
Definition at line 76 of file datasourcefactory.h.
|
inline |
Returns whether the datasourcefactory should download the file or not, true by default.
- Note
- can be used for multiple datasourcefactory downloads
Definition at line 141 of file datasourcefactory.h.
|
inline |
Definition at line 72 of file datasourcefactory.h.
|
inline |
- Returns
- true if the download was already initialized, i.e. a file has been created and maybe even written to
- See also
- deinit()
Definition at line 159 of file datasourcefactory.h.
bool DataSourceFactory::isValid | ( | ) | const |
- Returns
- true if the DataSourceFactory has enough information to start a download
Definition at line 1207 of file datasourcefactory.cpp.
|
slot |
Definition at line 952 of file datasourcefactory.cpp.
|
signal |
|
inline |
The maximum number of mirrors that will be used for downloading, default is 3.
Definition at line 81 of file datasourcefactory.h.
Return all mirrors, where bool defines if the mirror is used, while in defines the number of paralell connections for that mirror.
Definition at line 565 of file datasourcefactory.cpp.
|
inline |
Definition at line 74 of file datasourcefactory.h.
void DataSourceFactory::removeMirror | ( | const KUrl & | url | ) |
Does not use the specified mirror for downloading the file.
- Note
- if the mirror has bee unsed for downloading it will be moved to m_unusedMirrors, otherwise nohting will happen
- Parameters
-
url the mirror that should not be used anymore
Definition at line 503 of file datasourcefactory.cpp.
void DataSourceFactory::repair | ( | ) |
Tries to repair a broken download, via completely redownloading it or only the borken parts.
- Note
- call this if verification returned NotVerified
Definition at line 889 of file datasourcefactory.cpp.
|
slot |
Definition at line 1117 of file datasourcefactory.cpp.
void DataSourceFactory::setDoDownload | ( | bool | doDownload | ) |
Set if the datasourcefactory should download the file or not, if set to false the download will be stopped if needed.
- Note
- can be used for multiple datasourcefactory downloads
Definition at line 350 of file datasourcefactory.cpp.
|
inline |
Change the maximum number off mirrors that will be used for downloading, if the download started already some mirrors might be added or removed automatically.
Definition at line 87 of file datasourcefactory.h.
Sets the mirrors that should be used/not used for downloading.
- Parameters
-
mirrors url of the mirror, if it should be used and its number of paralell connections (minimum is 1)
- Note
- if you want the download to work at least one entry should be set to true
Definition at line 538 of file datasourcefactory.cpp.
bool DataSourceFactory::setNewDestination | ( | const KUrl & | newDest | ) |
Definition at line 823 of file datasourcefactory.cpp.
Signature * DataSourceFactory::signature | ( | ) |
Definition at line 1231 of file datasourcefactory.cpp.
|
inline |
Definition at line 71 of file datasourcefactory.h.
void DataSourceFactory::start | ( | ) |
Definition at line 193 of file datasourcefactory.cpp.
|
inline |
Definition at line 152 of file datasourcefactory.h.
void DataSourceFactory::stop | ( | ) |
Definition at line 327 of file datasourcefactory.cpp.
Verifier * DataSourceFactory::verifier | ( | ) |
Definition at line 1222 of file datasourcefactory.cpp.
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.