mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-31 12:00:16 -07:00
Fix compilation with libtorrent 0.15.x.
This commit is contained in:
parent
4c6f8413cb
commit
45d1e93ad2
2 changed files with 15 additions and 6 deletions
|
@ -177,18 +177,15 @@ void TorrentSpeedMonitor::getSamples()
|
||||||
try {
|
try {
|
||||||
#if LIBTORRENT_VERSION_NUM >= 001600
|
#if LIBTORRENT_VERSION_NUM >= 001600
|
||||||
torrent_status st = it->status(0x0);
|
torrent_status st = it->status(0x0);
|
||||||
|
#else
|
||||||
|
torrent_status st = it->status();
|
||||||
|
#endif
|
||||||
if (!st.paused) {
|
if (!st.paused) {
|
||||||
int up = st.upload_payload_rate;
|
int up = st.upload_payload_rate;
|
||||||
int down = st.download_payload_rate;
|
int down = st.download_payload_rate;
|
||||||
m_samples[misc::toQString(it->info_hash())].addSample(down, up);
|
m_samples[misc::toQString(it->info_hash())].addSample(down, up);
|
||||||
alltimeDL += down;
|
alltimeDL += down;
|
||||||
alltimeUL += up;
|
alltimeUL += up;
|
||||||
#else
|
|
||||||
if (!it->is_paused()) {
|
|
||||||
torrent_status st = it->status();
|
|
||||||
m_samples[misc::toQString(it->info_hash())].addSample(st.download_payload_rate, st.upload_payload_rate);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch(invalid_handle&) {}
|
} catch(invalid_handle&) {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,16 @@ StatsDialog::StatsDialog(QWidget *parent) : QDialog(parent), ui(new Ui::StatsD
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
connect(ui->buttonOK, SIGNAL(clicked()), SLOT(close()));
|
connect(ui->buttonOK, SIGNAL(clicked()), SLOT(close()));
|
||||||
|
#if LIBTORRENT_VERSION_NUM < 001600
|
||||||
|
ui->labelWriteStarveText->setVisible(false);
|
||||||
|
ui->labelWriteStarve->setVisible(false);
|
||||||
|
ui->labelReadStarveText->setVisible(false);
|
||||||
|
ui->labelReadStarve->setVisible(false);
|
||||||
|
ui->labelQueuedJobsText->setVisible(false);
|
||||||
|
ui->labelQueuedJobs->setVisible(false);
|
||||||
|
ui->labelJobsTimeText->setVisible(false);
|
||||||
|
ui->labelJobsTime->setVisible(false);
|
||||||
|
#endif
|
||||||
session = QBtSession::instance();
|
session = QBtSession::instance();
|
||||||
updateUI();
|
updateUI();
|
||||||
t = new QTimer(this);
|
t = new QTimer(this);
|
||||||
|
@ -78,6 +88,7 @@ void StatsDialog::updateUI() {
|
||||||
);
|
);
|
||||||
// Buffers size
|
// Buffers size
|
||||||
ui->labelTotalBuf->setText(misc::friendlyUnit(cache.total_used_buffers * 16 * 1024));
|
ui->labelTotalBuf->setText(misc::friendlyUnit(cache.total_used_buffers * 16 * 1024));
|
||||||
|
#if LIBTORRENT_VERSION_NUM >= 001600
|
||||||
// Disk overload (100%) equivalent
|
// Disk overload (100%) equivalent
|
||||||
// From lt manual: disk_write_queue and disk_read_queue are the number of peers currently waiting on a disk write or disk read
|
// From lt manual: disk_write_queue and disk_read_queue are the number of peers currently waiting on a disk write or disk read
|
||||||
// to complete before it receives or sends any more data on the socket. It'a a metric of how disk bound you are.
|
// to complete before it receives or sends any more data on the socket. It'a a metric of how disk bound you are.
|
||||||
|
@ -102,6 +113,7 @@ void StatsDialog::updateUI() {
|
||||||
// Disk queues
|
// Disk queues
|
||||||
ui->labelQueuedJobs->setText(QString::number(cache.job_queue_length));
|
ui->labelQueuedJobs->setText(QString::number(cache.job_queue_length));
|
||||||
ui->labelJobsTime->setText(QString::number(cache.average_job_time));
|
ui->labelJobsTime->setText(QString::number(cache.average_job_time));
|
||||||
|
#endif
|
||||||
ui->labelQueuedBytes->setText(misc::friendlyUnit(cache.queued_bytes));
|
ui->labelQueuedBytes->setText(misc::friendlyUnit(cache.queued_bytes));
|
||||||
|
|
||||||
// Total connected peers
|
// Total connected peers
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue