From b35cc2c9e4aff7661fbe4541c5df602453a014e0 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Thu, 19 Nov 2009 17:13:53 +0000 Subject: [PATCH] - Support up to 99999 peers (for display). It used to be 9999 but this was not enough for some torrents. --- src/TransferListDelegate.h | 4 ++-- src/TransferListWidget.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/TransferListDelegate.h b/src/TransferListDelegate.h index 027c276dd..501d2c1c4 100644 --- a/src/TransferListDelegate.h +++ b/src/TransferListDelegate.h @@ -70,10 +70,10 @@ public: case SEEDS: case PEERS: { qulonglong tot_val = index.data().toULongLong(); - QString display = QString::number((qulonglong)tot_val/100000); + QString display = QString::number((qulonglong)tot_val/1000000); if(tot_val%2 == 0) { // Scrape was sucessful, we have total values - display += " ("+QString::number((qulonglong)(tot_val%100000)/10)+")"; + display += " ("+QString::number((qulonglong)(tot_val%1000000)/10)+")"; } QItemDelegate::drawBackground(painter, opt, index); opt.displayAlignment = Qt::AlignRight; diff --git a/src/TransferListWidget.cpp b/src/TransferListWidget.cpp index fd4bd8cd0..14ece79af 100644 --- a/src/TransferListWidget.cpp +++ b/src/TransferListWidget.cpp @@ -304,13 +304,13 @@ int TransferListWidget::updateTorrent(int row) { listModel->setData(listModel->index(row, DLSPEED), QVariant((double)h.download_payload_rate())); // Connected_seeds*100000+total_seeds*10 (if total_seeds is available) // Connected_seeds*100000+1 (if total_seeds is unavailable) - qulonglong seeds = h.num_seeds()*100000; + qulonglong seeds = h.num_seeds()*1000000; if(h.num_complete() >= h.num_seeds()) seeds += h.num_complete()*10; else seeds += 1; listModel->setData(listModel->index(row, SEEDS), QVariant(seeds)); - qulonglong peers = (h.num_peers()-h.num_seeds())*100000; + qulonglong peers = (h.num_peers()-h.num_seeds())*1000000; if(h.num_incomplete() >= (h.num_peers()-h.num_seeds())) peers += h.num_incomplete()*10; else