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

kget

  • sources
  • kde-4.12
  • kdenetwork
  • kget
  • core
transferdatasource.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE project
2 
3  Copyright (C) 2008 Manolo Valdes <nolis71cu@gmail.com>
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 */
10 
11 #include "transferdatasource.h"
12 
13 #include <kdebug.h>
14 
15 TransferDataSource::TransferDataSource(const KUrl &srcUrl, QObject *parent)
16  : QObject(parent),
17  m_sourceUrl(srcUrl),
18  m_speed(0),
19  m_supposedSize(0),
20  m_paralellSegments(1),
21  m_currentSegments(0),
22  m_capabilities(0)
23 {
24  kDebug(5001) ;
25 }
26 
27 TransferDataSource::~TransferDataSource()
28 {
29  kDebug(5001) ;
30 }
31 
32 Transfer::Capabilities TransferDataSource::capabilities() const
33 {
34  return m_capabilities;
35 }
36 
37 void TransferDataSource::setCapabilities(Transfer::Capabilities capabilities)
38 {
39  m_capabilities = capabilities;
40  emit capabilitiesChanged();
41 }
42 
43 void TransferDataSource::findFileSize(KIO::fileoffset_t segmentSize)
44 {
45  Q_UNUSED(segmentSize);
46 }
47 
48 QPair<int, int> TransferDataSource::removeConnection()
49 {
50  return QPair<int, int>(-1, -1);
51 }
52 
53 QList<QPair<int, int> > TransferDataSource::assignedSegments() const
54 {
55  return QList<QPair<int, int> >();
56 }
57 
58 int TransferDataSource::countUnfinishedSegments() const
59 {
60  return 0;
61 }
62 
63 QPair<int, int> TransferDataSource::split()
64 {
65  return QPair<int, int>(-1, -1);
66 }
67 
68 int TransferDataSource::paralellSegments() const
69 {
70  return m_paralellSegments;
71 }
72 
73 void TransferDataSource::setParalellSegments(int paralellSegments)
74 {
75  m_paralellSegments = paralellSegments;
76 }
77 
78 int TransferDataSource::currentSegments() const
79 {
80  return m_currentSegments;
81 }
82 
83 int TransferDataSource::changeNeeded() const
84 {
85  return paralellSegments() - currentSegments();
86 }
87 
88 
89 #include "transferdatasource.moc"
TransferDataSource::currentSegments
virtual int currentSegments() const
Definition: transferdatasource.cpp:78
TransferDataSource::TransferDataSource
TransferDataSource(const KUrl &srcUrl, QObject *parent)
Definition: transferdatasource.cpp:15
TransferDataSource::capabilitiesChanged
void capabilitiesChanged()
Emitted when the capabilities of the TransferDataSource change.
TransferDataSource::findFileSize
virtual void findFileSize(KIO::fileoffset_t segmentSize)
Tries to find the filesize if this capability is supported, if successfull it emits foundFileSize(Tra...
Definition: transferdatasource.cpp:43
QObject
TransferDataSource::assignedSegments
virtual QList< QPair< int, int > > assignedSegments() const
Returns the assignedSegments to this TransferDataSource Each connection is represented by a QPair...
Definition: transferdatasource.cpp:53
TransferDataSource::m_currentSegments
int m_currentSegments
Definition: transferdatasource.h:246
TransferDataSource::~TransferDataSource
virtual ~TransferDataSource()
Definition: transferdatasource.cpp:27
TransferDataSource::setCapabilities
void setCapabilities(Transfer::Capabilities capabilities)
Sets the capabilities and automatically emits capabilitiesChanged.
Definition: transferdatasource.cpp:37
TransferDataSource::changeNeeded
virtual int changeNeeded() const
Returns the missmatch of paralellSegments() and currentSegments()
Definition: transferdatasource.cpp:83
transferdatasource.h
TransferDataSource::countUnfinishedSegments
virtual int countUnfinishedSegments() const
Returns the number of unfinished Segments of the connection with the most unfinished segments Each Tr...
Definition: transferdatasource.cpp:58
TransferDataSource::split
virtual QPair< int, int > split()
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.
Definition: transferdatasource.cpp:63
TransferDataSource::m_paralellSegments
int m_paralellSegments
Definition: transferdatasource.h:245
TransferDataSource::setParalellSegments
virtual void setParalellSegments(int paralellSegments)
Sets the number of paralell segments this DataSource is allowed to use.
Definition: transferdatasource.cpp:73
TransferDataSource::capabilities
Transfer::Capabilities capabilities() const
Returns the capabilities this TransferDataSource supports.
Definition: transferdatasource.cpp:32
TransferDataSource::removeConnection
virtual QPair< int, int > removeConnection()
Removes one connection, useful when setMaximumParalellDownloads was called with a lower number...
Definition: transferdatasource.cpp:48
TransferDataSource::paralellSegments
virtual int paralellSegments() const
Definition: transferdatasource.cpp:68
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:17 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