mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00:00
- Fixed folder progress calculation in torrent properties (closes #154387)
This commit is contained in:
parent
03719cbb87
commit
1519bca46d
1
TODO
1
TODO
@ -61,4 +61,5 @@ rc5->rc6 changelog:
|
|||||||
- BUGFIX: configure looks for libraries in lib64 folders too
|
- BUGFIX: configure looks for libraries in lib64 folders too
|
||||||
- BUGFIX: configure doesn't require paths with a terminal "/" anymore
|
- BUGFIX: configure doesn't require paths with a terminal "/" anymore
|
||||||
- BUGFIX: Fixed minimize to tray feature
|
- BUGFIX: Fixed minimize to tray feature
|
||||||
|
- BUGFIX: Fixed folders progress calculation in torrent properties
|
||||||
- I18N: Fixed swedish, French, Spanish translations
|
- I18N: Fixed swedish, French, Spanish translations
|
@ -62,12 +62,20 @@ class file {
|
|||||||
|
|
||||||
void updateProgress() {
|
void updateProgress() {
|
||||||
Q_ASSERT(is_dir);
|
Q_ASSERT(is_dir);
|
||||||
float sum = 0;
|
if(children.isEmpty()) {
|
||||||
|
progress = 0.;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
float wanted = 0.;
|
||||||
|
float done = 0.;
|
||||||
file *child;
|
file *child;
|
||||||
foreach(child, children) {
|
foreach(child, children) {
|
||||||
sum += child->getProgress();
|
wanted += child->getSize();
|
||||||
|
done += child->getSize()*child->getProgress();
|
||||||
}
|
}
|
||||||
progress = sum / (float)children.size();
|
progress = done / wanted;
|
||||||
|
Q_ASSERT(progress >= 0.);
|
||||||
|
Q_ASSERT(progress <= 1.);
|
||||||
}
|
}
|
||||||
|
|
||||||
void updatePriority(int prio) {
|
void updatePriority(int prio) {
|
||||||
|
@ -154,8 +154,8 @@ void bittorrent::updateETAs() {
|
|||||||
Q_ASSERT(nbETAs);
|
Q_ASSERT(nbETAs);
|
||||||
foreach(val, listEtas) {
|
foreach(val, listEtas) {
|
||||||
moy += (qlonglong)((double)val/(double)nbETAs);
|
moy += (qlonglong)((double)val/(double)nbETAs);
|
||||||
Q_ASSERT(moy >= 0);
|
|
||||||
}
|
}
|
||||||
|
Q_ASSERT(moy >= 0);
|
||||||
ETAs[hash] = moy;
|
ETAs[hash] = moy;
|
||||||
} else {
|
} else {
|
||||||
// Speed is too low, we don't want an overflow.
|
// Speed is too low, we don't want an overflow.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user