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 "kget_debug.h"
14 #include <QDebug>
15 
TransferDataSource(const QUrl & srcUrl,QObject * parent)16 TransferDataSource::TransferDataSource(const QUrl &srcUrl, QObject *parent)
17   : QObject(parent),
18     m_sourceUrl(srcUrl),
19     m_speed(0),
20     m_supposedSize(0),
21     m_parallelSegments(1),
22     m_currentSegments(0),
23     m_capabilities()
24 {
25     qCDebug(KGET_DEBUG) ;
26 }
27 
~TransferDataSource()28 TransferDataSource::~TransferDataSource()
29 {
30     qCDebug(KGET_DEBUG) ;
31 }
32 
capabilities() const33 Transfer::Capabilities TransferDataSource::capabilities() const
34 {
35     return m_capabilities;
36 }
37 
setCapabilities(Transfer::Capabilities capabilities)38 void TransferDataSource::setCapabilities(Transfer::Capabilities capabilities)
39 {
40     m_capabilities = capabilities;
41     Q_EMIT capabilitiesChanged();
42 }
43 
findFileSize(KIO::fileoffset_t segmentSize)44 void TransferDataSource::findFileSize(KIO::fileoffset_t segmentSize)
45 {
46     Q_UNUSED(segmentSize);
47 }
48 
removeConnection()49 QPair<int, int> TransferDataSource::removeConnection()
50 {
51     return QPair<int, int>(-1, -1);
52 }
53 
assignedSegments() const54 QList<QPair<int, int> > TransferDataSource::assignedSegments() const
55 {
56     return QList<QPair<int, int> >();
57 }
58 
countUnfinishedSegments() const59 int TransferDataSource::countUnfinishedSegments() const
60 {
61     return 0;
62 }
63 
split()64 QPair<int, int> TransferDataSource::split()
65 {
66     return QPair<int, int>(-1, -1);
67 }
68 
parallelSegments() const69 int TransferDataSource::parallelSegments() const
70 {
71     return m_parallelSegments;
72 }
73 
setParallelSegments(int parallelSegments)74 void TransferDataSource::setParallelSegments(int parallelSegments)
75 {
76     m_parallelSegments = parallelSegments;
77 }
78 
currentSegments() const79 int TransferDataSource::currentSegments() const
80 {
81     return m_currentSegments;
82 }
83 
changeNeeded() const84 int TransferDataSource::changeNeeded() const
85 {
86     return parallelSegments() - currentSegments();
87 }
88 
89 
90 
91