• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kget

Public Slots | Signals | Public Member Functions | List of all members
DataSourceFactory Class Reference

#include <datasourcefactory.h>

Inheritance diagram for DataSourceFactory:
Inheritance graph
[legend]

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 ()
 
- Public Member Functions inherited from QObject
 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 &regExp) 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

- Static Public Member Functions inherited from QObject
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 inherited from QObject
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)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 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

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

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
urlthe url to the file
useddefines whether the mirror should initially be used for downloading or not, if true m_maxMirrorsUsed might be increased if needed
numParalellConnectionsthe 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
urlthe url to the file
numParalellConnectionsthe 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

The capabilities the DataSourceFactory supports.

Definition at line 55 of file datasourcefactory.h.

void DataSourceFactory::capabilitiesChanged ( )
signal
ulong DataSourceFactory::currentSpeed ( ) const
inline

Definition at line 73 of file datasourcefactory.h.

void DataSourceFactory::dataSourceFactoryChange ( Transfer::ChangesFlags  change)
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.

KUrl DataSourceFactory::dest ( ) const
inline

Definition at line 76 of file datasourcefactory.h.

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

Definition at line 72 of file datasourcefactory.h.

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
Returns
true if the DataSourceFactory has enough information to start a download

Definition at line 1207 of file datasourcefactory.cpp.

void DataSourceFactory::load ( const QDomElement *  e)
slot

Definition at line 952 of file datasourcefactory.cpp.

void DataSourceFactory::log ( const QString &  message,
Transfer::LogLevel  logLevel 
)
signal
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

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
urlthe 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

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.

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

KIO::filesize_t DataSourceFactory::size ( ) const
inline

Definition at line 71 of file datasourcefactory.h.

void DataSourceFactory::start ( )

Definition at line 193 of file datasourcefactory.cpp.

Job::Status DataSourceFactory::status ( ) const
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:
  • datasourcefactory.h
  • datasourcefactory.cpp
This file is part of the KDE documentation.
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.

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal