|
|
@ -48,7 +48,6 @@ public: |
|
|
|
SpeedSample() {} |
|
|
|
SpeedSample() {} |
|
|
|
void addSample(int speedDL, int speedUL); |
|
|
|
void addSample(int speedDL, int speedUL); |
|
|
|
Sample<qreal> average() const; |
|
|
|
Sample<qreal> average() const; |
|
|
|
void clear(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
static const int max_samples = 30; |
|
|
|
static const int max_samples = 30; |
|
|
@ -92,11 +91,6 @@ Sample<qreal> SpeedSample::average() const |
|
|
|
return Sample<qreal>(sumDL/numSamples, sumUL/numSamples); |
|
|
|
return Sample<qreal>(sumDL/numSamples, sumUL/numSamples); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SpeedSample::clear() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
m_speedSamples.clear(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TorrentSpeedMonitor::removeSamples(const QString &hash) |
|
|
|
void TorrentSpeedMonitor::removeSamples(const QString &hash) |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_samples.remove(hash); |
|
|
|
m_samples.remove(hash); |
|
|
|