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

kget

Public Member Functions | List of all members
MultiSegKioDataSource Class Reference

#include <multisegkiodatasource.h>

Inheritance diagram for MultiSegKioDataSource:
Inheritance graph
[legend]

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 ()
 
- Public Member Functions inherited from TransferDataSource
 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

- Public Types inherited from TransferDataSource
enum  Error { Unknown, WrongDownloadSize, NotResumeable }
 
- Signals inherited from TransferDataSource
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)
 
- Protected Member Functions inherited from TransferDataSource
void setCapabilities (Transfer::Capabilities capabilities)
 
- Protected Attributes inherited from TransferDataSource
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

void MultiSegKioDataSource::addSegments ( const QPair< KIO::fileoffset_t, KIO::fileoffset_t > &  segmentSize,
const QPair< int, int > &  segmentRange 
)
virtual

Adds multiple continuous segments that should be downloaded by this TransferDataSource.

Parameters
segmentSizefirst 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.
segmentRangefirst the beginning, second the end

Implements TransferDataSource.

Definition at line 72 of file multisegkiodatasource.cpp.

QList< QPair< int, int > > MultiSegKioDataSource::assignedSegments ( ) const
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.

int MultiSegKioDataSource::countUnfinishedSegments ( ) const
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.

int MultiSegKioDataSource::currentSegments ( ) const
virtual
Returns
the number of paralell segments this DataSources currently uses

Reimplemented from TransferDataSource.

Definition at line 157 of file multisegkiodatasource.cpp.

void MultiSegKioDataSource::findFileSize ( KIO::fileoffset_t  segmentSize)
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
segmentSizethe segments should have

Reimplemented from TransferDataSource.

Definition at line 98 of file multisegkiodatasource.cpp.

QPair< int, int > MultiSegKioDataSource::removeConnection ( )
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.

void MultiSegKioDataSource::setSupposedSize ( KIO::filesize_t  supposedSize)
virtual

Set the size the server used for downloading should report.

Parameters
supposedSizethe size the file should have

Reimplemented from TransferDataSource.

Definition at line 120 of file multisegkiodatasource.cpp.

QPair< int, int > MultiSegKioDataSource::split ( )
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.

void MultiSegKioDataSource::start ( )
virtual

Implements TransferDataSource.

Definition at line 33 of file multisegkiodatasource.cpp.

void MultiSegKioDataSource::stop ( )
virtual

Implements TransferDataSource.

Definition at line 44 of file multisegkiodatasource.cpp.


The documentation for this class was generated from the following files:
  • multisegkiodatasource.h
  • multisegkiodatasource.cpp
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.

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