mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
- Added ratio column
This commit is contained in:
parent
eb3db365e7
commit
86a0e68f46
8 changed files with 110 additions and 27 deletions
|
@ -69,17 +69,20 @@ properties::properties(QWidget *parent, bittorrent *BTSession, torrent_handle &h
|
|||
upTotal->setText(misc::friendlyUnit(torrentStatus.total_payload_upload));
|
||||
dlTotal->setText(misc::friendlyUnit(torrentStatus.total_payload_download));
|
||||
// Update ratio info
|
||||
if(torrentStatus.total_payload_download <= 0 || torrentStatus.total_payload_upload <= 0){
|
||||
shareRatio->setText(tr("Unknown"));
|
||||
float ratio;
|
||||
if(torrentStatus.total_payload_download == 0){
|
||||
if(torrentStatus.total_payload_upload == 0)
|
||||
ratio = 1.;
|
||||
else
|
||||
ratio = 10.; // Max ratio
|
||||
}else{
|
||||
float ratio = 1.;
|
||||
ratio = (float)torrentStatus.total_payload_upload/(float)torrentStatus.total_payload_download;
|
||||
if(ratio > 10.){
|
||||
ratio = 10.;
|
||||
}
|
||||
snprintf(tmp, MAX_CHAR_TMP, "%.1f", ratio);
|
||||
shareRatio->setText(tmp);
|
||||
}
|
||||
snprintf(tmp, MAX_CHAR_TMP, "%.1f", ratio);
|
||||
shareRatio->setText(tmp);
|
||||
// Tracker Errors
|
||||
for(int i=0; i < trackerErrors.size(); ++i){
|
||||
this->trackerErrors->append(trackerErrors.at(i));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue