Add compile definition to indicate using of libtorrent 2.0 (#15297)

The compile definition is temporary which will be removed when qbt
ditches libtorrent 1.x.
This commit is contained in:
Chocobo1 2021-08-08 13:27:22 +08:00 committed by GitHub
parent bed643e627
commit 138c911ef4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 85 additions and 93 deletions

View file

@ -55,7 +55,7 @@ StatsDialog::StatsDialog(QWidget *parent)
connect(BitTorrent::Session::instance(), &BitTorrent::Session::statsUpdated
, this, &StatsDialog::update);
#if (LIBTORRENT_VERSION_NUM >= 20000)
#ifdef QBT_USES_LIBTORRENT2
m_ui->labelCacheHitsText->hide();
m_ui->labelCacheHits->hide();
#endif
@ -87,7 +87,7 @@ void StatsDialog::update()
((atd > 0) && (atu > 0))
? Utils::String::fromDouble(static_cast<qreal>(atu) / atd, 2)
: "-");
#if (LIBTORRENT_VERSION_NUM < 20000)
#ifndef QBT_USES_LIBTORRENT2
// Cache hits
const qreal readRatio = cs.readRatio;
m_ui->labelCacheHits->setText(QString::fromLatin1("%1%").arg((readRatio > 0)