- Fixed an overflow that could cause ETA to become negative sometimes (hitted an assert)

This commit is contained in:
Christophe Dumez 2007-09-16 12:30:41 +00:00
parent 925ecb3464
commit 3cb34ed7ee
2 changed files with 7 additions and 6 deletions

2
TODO
View file

@ -53,7 +53,6 @@
* beta 7
- update doc for plugins (and add screenies)
- update doc for options
- See bug about negative ETA
- Translations update (IN PROGRESS)
- Wait that http://pastebin.ca/690649 is fixed
@ -114,6 +113,7 @@ beta6->beta7 changelog:
- BUGFIX: improved search engine plugin manager code and fixed bugs
- BUGFIX: Dropped Qt4.2 support, becomes too difficult to maintain
- BUGFIX: Fixed deprecation warning with latest libtorrent svn
- BUGFIX: Fixed an overflow causing ETA to become negative sometimes (hitted an assert)
- COSMETIC: Improved some icons
- COSMETIC: Totally redesigned program preferences
- COSMETIC: Improved systray tooltip style

View file

@ -160,13 +160,14 @@ void bittorrent::updateETAs() {
unsigned int nbETAs = listEtas.size();
Q_ASSERT(nbETAs);
foreach(val, listEtas) {
// TODO: Remove this debug when #137223 is fixed
qDebug("old moy: %ld", (long)moy);
moy += (qlonglong)((double)val/(double)nbETAs);
qDebug("ETA: %ld, nbETAs: %d, moy: %ld", (long)val, nbETAs, (long)moy);
Q_ASSERT(moy >= 0);
if(moy < 0) break;
}
if(moy < 0) {
ETAs.remove(hash);
} else {
ETAs[hash] = moy;
}
ETAs[hash] = moy;
}
}
}