mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
- Fixed share ratio display in properties widget and in Web UI
This commit is contained in:
parent
9ada7c809b
commit
4908458729
3 changed files with 18 additions and 16 deletions
|
@ -320,19 +320,11 @@ void PropertiesWidget::loadDynamicData() {
|
|||
else
|
||||
lbl_connections->setText(QString::number(h.num_connections()));
|
||||
// Update ratio info
|
||||
float ratio;
|
||||
if(h.total_payload_download() == 0){
|
||||
if(h.total_payload_upload() == 0)
|
||||
ratio = 1.;
|
||||
else
|
||||
ratio = 10.; // Max ratio
|
||||
}else{
|
||||
ratio = (double)h.total_payload_upload()/(double)h.total_payload_download();
|
||||
if(ratio > 10.){
|
||||
ratio = 10.;
|
||||
}
|
||||
}
|
||||
shareRatio->setText(QString(QByteArray::number(ratio, 'f', 1)));
|
||||
double ratio = BTSession->getRealRatio(h.hash());
|
||||
if(ratio > 100.)
|
||||
shareRatio->setText(QString::fromUtf8("∞"));
|
||||
else
|
||||
shareRatio->setText(QString(QByteArray::number(ratio, 'f', 1)));
|
||||
if(!h.is_seed()) {
|
||||
// Downloaded pieces
|
||||
downloaded_pieces->setProgress(h.pieces());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue