kget
#include <multisegkiodatasource.h>

Public Member Functions | |
MultiSegKioDataSource (const KUrl &srcUrl, QObject *parent) | |
~MultiSegKioDataSource () | |
void | addSegments (const QPair< KIO::fileoffset_t, KIO::fileoffset_t > &segmentSize, const QPair< int, int > &segmentRange) |
QList< QPair< int, int > > | assignedSegments () const |
int | countUnfinishedSegments () const |
int | currentSegments () const |
void | findFileSize (KIO::fileoffset_t segmentSize) |
QPair< int, int > | removeConnection () |
void | setSupposedSize (KIO::filesize_t supposedSize) |
QPair< int, int > | split () |
void | start () |
void | stop () |
![]() | |
TransferDataSource (const KUrl &srcUrl, QObject *parent) | |
virtual | ~TransferDataSource () |
Transfer::Capabilities | capabilities () const |
virtual int | changeNeeded () const |
ulong | currentSpeed () const |
virtual int | paralellSegments () const |
virtual void | setParalellSegments (int paralellSegments) |
KUrl | sourceUrl () const |
Additional Inherited Members | |
![]() | |
enum | Error { Unknown, WrongDownloadSize, NotResumeable } |
![]() | |
void | broken (TransferDataSource *source, TransferDataSource::Error error) |
void | brokenSegments (TransferDataSource *source, QPair< int, int > segmentRange) |
void | capabilitiesChanged () |
void | data (KIO::fileoffset_t offset, const QByteArray &data, bool &worked) |
void | data (const QList< KUrl > &data) |
void | data (const QString type, const QString checksum) |
void | finished () |
void | finishedDownload (TransferDataSource *source, KIO::filesize_t fileSize) |
void | finishedSegment (TransferDataSource *source, int segmentNumber, bool connectionFinished=true) |
void | foundFileSize (TransferDataSource *source, KIO::filesize_t fileSize, const QPair< int, int > &segmentRange) |
void | freeSegments (TransferDataSource *source, QPair< int, int > segmentRange) |
void | log (const QString &message, Transfer::LogLevel logLevel) |
void | speed (ulong speed) |
void | urlChanged (const KUrl &old, const KUrl &newUrl) |
![]() | |
void | setCapabilities (Transfer::Capabilities capabilities) |
![]() | |
int | m_currentSegments |
int | m_paralellSegments |
KUrl | m_sourceUrl |
ulong | m_speed |
KIO::filesize_t | m_supposedSize |
Detailed Description
Definition at line 19 of file multisegkiodatasource.h.
Constructor & Destructor Documentation
MultiSegKioDataSource::MultiSegKioDataSource | ( | const KUrl & | srcUrl, |
QObject * | parent | ||
) |
Definition at line 18 of file multisegkiodatasource.cpp.
MultiSegKioDataSource::~MultiSegKioDataSource | ( | ) |
Definition at line 28 of file multisegkiodatasource.cpp.
Member Function Documentation
|
virtual |
Adds multiple continuous segments that should be downloaded by this TransferDataSource.
- Parameters
-
segmentSize first is always the general segmentSize, second the segmentSize of the last segment in the range. If just one (the last) segment was assigned, then first would not equal second, this is to ensure that first can be used to calculate the offset TransferDataSources have to handle all that internally. segmentRange first the beginning, second the end
Implements TransferDataSource.
Definition at line 72 of file multisegkiodatasource.cpp.
|
virtual |
Returns the assignedSegments to this TransferDataSource Each connection is represented by a QPair, where the first int is the beginning segment and the last the ending segment.
- Note
- an empty list is returned by default, the elements can also be (-1, -1)
Reimplemented from TransferDataSource.
Definition at line 61 of file multisegkiodatasource.cpp.
|
virtual |
Returns the number of unfinished Segments of the connection with the most unfinished segments Each TransferDataSource can have multiple connections and each connection can have multiple segments assigned.
- Note
- default implemention returns 0
Reimplemented from TransferDataSource.
Definition at line 183 of file multisegkiodatasource.cpp.
|
virtual |
- Returns
- the number of paralell segments this DataSources currently uses
Reimplemented from TransferDataSource.
Definition at line 157 of file multisegkiodatasource.cpp.
|
virtual |
Tries to find the filesize if this capability is supported, if successfull it emits foundFileSize(TransferDataSource*,KIO::filesize_t,QPair<int,int>) and assigns all segements to itself if not succesfull it will try to download the file nevertheless.
- Note
- if stop is called and no size is found yet then this is aborted, i.e. needs to be called again if start is later called
- Parameters
-
segmentSize the segments should have
Reimplemented from TransferDataSource.
Definition at line 98 of file multisegkiodatasource.cpp.
|
virtual |
Removes one connection, useful when setMaximumParalellDownloads was called with a lower number.
- Returns
- the segments that are removed (unassigned) now
Reimplemented from TransferDataSource.
Definition at line 202 of file multisegkiodatasource.cpp.
|
virtual |
Set the size the server used for downloading should report.
- Parameters
-
supposedSize the size the file should have
Reimplemented from TransferDataSource.
Definition at line 120 of file multisegkiodatasource.cpp.
|
virtual |
If a connection of this TransferDataSource is assigned multiple (continuous) segments, then this method will split them (the unfinished ones) in half, it returns the beginning and the end of the now unassigned segments; (-1, -1) if there are none.
- Note
- if only one segment is assigned to a connection split will also return (-1, -1)
Reimplemented from TransferDataSource.
Definition at line 191 of file multisegkiodatasource.cpp.
|
virtual |
Implements TransferDataSource.
Definition at line 33 of file multisegkiodatasource.cpp.
|
virtual |
Implements TransferDataSource.
Definition at line 44 of file multisegkiodatasource.cpp.
The documentation for this class was generated from the following files:
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.