Show "N/A" if there is no scrape

Disambiguates whether the tracker send a response of 0 peers/seeds/downloaded or didn't send one at all.
This commit is contained in:
thalieht 2018-09-07 09:49:15 +03:00 committed by sledgehammer999
commit 84f0dbecfe
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2

View file

@ -367,13 +367,13 @@ void TrackerListWidget::loadTrackers()
item->setText(COL_RECEIVED, QString::number(data.numPeers)); item->setText(COL_RECEIVED, QString::number(data.numPeers));
#if LIBTORRENT_VERSION_NUM >= 10000 #if LIBTORRENT_VERSION_NUM >= 10000
item->setText(COL_SEEDS, QString::number(entry.nativeEntry().scrape_complete > 0 ? entry.nativeEntry().scrape_complete : 0)); item->setText(COL_SEEDS, (entry.nativeEntry().scrape_complete > -1) ? QString::number(entry.nativeEntry().scrape_complete) : tr("N/A"));
item->setText(COL_PEERS, QString::number(entry.nativeEntry().scrape_incomplete > 0 ? entry.nativeEntry().scrape_incomplete : 0)); item->setText(COL_PEERS, (entry.nativeEntry().scrape_incomplete > -1) ? QString::number(entry.nativeEntry().scrape_incomplete) : tr("N/A"));
item->setText(COL_DOWNLOADED, QString::number(entry.nativeEntry().scrape_downloaded > 0 ? entry.nativeEntry().scrape_downloaded : 0)); item->setText(COL_DOWNLOADED, (entry.nativeEntry().scrape_downloaded > -1) ? QString::number(entry.nativeEntry().scrape_downloaded) : tr("N/A"));
#else #else
item->setText(COL_SEEDS, '0'); item->setText(COL_SEEDS, tr("N/A"));
item->setText(COL_PEERS, '0'); item->setText(COL_PEERS, tr("N/A"));
item->setText(COL_DOWNLOADED, '0'); item->setText(COL_DOWNLOADED, tr("N/A"));
#endif #endif
item->setTextAlignment(COL_TIER, (Qt::AlignRight | Qt::AlignVCenter)); item->setTextAlignment(COL_TIER, (Qt::AlignRight | Qt::AlignVCenter));