#include <datasourcefactory.h>
|
void | load (const QDomElement *e) |
|
void | save (const QDomElement &element) |
|
|
| 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 () |
|
This class manages multiple DataSources and saves the received data to the file.
Definition at line 38 of file datasourcefactory.h.
DataSourceFactory::DataSourceFactory |
( |
QObject * |
parent, |
|
|
const KUrl & |
dest = KUrl() , |
|
|
KIO::filesize_t |
size = 0 , |
|
|
KIO::fileoffset_t |
segSize = 512000 |
|
) |
| |
|
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 |
( |
| ) |
|
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.
Transfer::Capabilities DataSourceFactory::capabilities |
( |
| ) |
const |
|
inline |
void DataSourceFactory::capabilitiesChanged |
( |
| ) |
|
|
signal |
ulong DataSourceFactory::currentSpeed |
( |
| ) |
const |
|
inline |
void DataSourceFactory::deinit |
( |
| ) |
|
KUrl DataSourceFactory::dest |
( |
| ) |
const |
|
inline |
bool DataSourceFactory::doDownload |
( |
| ) |
const |
|
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.
KIO::filesize_t DataSourceFactory::downloadedSize |
( |
| ) |
const |
|
inline |
bool DataSourceFactory::downloadInitialized |
( |
| ) |
const |
|
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 |
void DataSourceFactory::load |
( |
const QDomElement * |
e | ) |
|
|
slot |
int DataSourceFactory::maxMirrorsUsed |
( |
| ) |
const |
|
inline |
The maximum number of mirrors that will be used for downloading, default is 3.
Definition at line 81 of file datasourcefactory.h.
QHash< KUrl, QPair< bool, int > > DataSourceFactory::mirrors |
( |
| ) |
const |
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.
ulong DataSourceFactory::percent |
( |
| ) |
const |
|
inline |
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.
void DataSourceFactory::save |
( |
const QDomElement & |
element | ) |
|
|
slot |
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.
void DataSourceFactory::setMaxMirrorsUsed |
( |
int |
maxMirrorsUsed | ) |
|
|
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.
void DataSourceFactory::setMirrors |
( |
const QHash< KUrl, QPair< bool, int > > & |
mirrors | ) |
|
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 | ) |
|
KIO::filesize_t DataSourceFactory::size |
( |
| ) |
const |
|
inline |
void DataSourceFactory::start |
( |
| ) |
|
void DataSourceFactory::stop |
( |
| ) |
|
Verifier * DataSourceFactory::verifier |
( |
| ) |
|
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:18 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.