Bandwidth: Fix issue with removed download jobs

The measuring broke when a job that is currently measuring was removed.
This commit is contained in:
Markus Goetz 2014-12-02 09:37:48 +01:00
parent 3f5887cc03
commit 92ce707268

View file

@ -118,6 +118,7 @@ void BandwidthManager::unregisterUploadDevice(UploadDevice* p)
_relativeUploadDeviceList.removeAll(p);
if (p == _relativeLimitCurrentMeasuredDevice) {
_relativeLimitCurrentMeasuredDevice = 0;
_relativeUploadLimitProgressAtMeasuringRestart = 0;
}
}
@ -142,6 +143,10 @@ void BandwidthManager::registerDownloadJob(GETFileJob* j)
void BandwidthManager::unregisterDownloadJob(GETFileJob* j)
{
_downloadJobList.removeAll(j);
if (_relativeLimitCurrentMeasuredJob == j) {
_relativeLimitCurrentMeasuredJob = 0;
_relativeDownloadLimitProgressAtMeasuringRestart = 0;
}
}
void BandwidthManager::unregisterDownloadJob(QObject* o)