Remove redundant suffix from TorrentHandle class

Originally, it was just a wrapper for libtorrent::torrent_handle class, so it mimicked its name.
It was then transformed into a more complex aggregate, but the name was retained (just by inertia).
Unlike libtorrent::torrent_handle class in whose name "handle" means the pattern used,
it does not matter for qBittorrent classes and just eats up space in the source code.
This commit is contained in:
Vladimir Golovnev (Glassez) 2021-01-06 15:12:40 +03:00
parent 35731b96dc
commit 0b4fef19f6
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7
52 changed files with 647 additions and 647 deletions

View file

@ -33,7 +33,7 @@
#include "base/bittorrent/infohash.h"
#include "base/bittorrent/session.h"
#include "base/bittorrent/torrenthandle.h"
#include "base/bittorrent/torrent.h"
#include "base/global.h"
#include "base/unicodestrings.h"
#include "ui_torrentoptionsdialog.h"
@ -53,7 +53,7 @@ namespace
}
}
TorrentOptionsDialog::TorrentOptionsDialog(QWidget *parent, const QVector<BitTorrent::TorrentHandle *> &torrents)
TorrentOptionsDialog::TorrentOptionsDialog(QWidget *parent, const QVector<BitTorrent::Torrent *> &torrents)
: QDialog {parent}
, m_ui {new Ui::TorrentOptionsDialog}
, m_storeDialogSize {SETTINGS_KEY("Size")}
@ -76,7 +76,7 @@ TorrentOptionsDialog::TorrentOptionsDialog(QWidget *parent, const QVector<BitTor
const bool isFirstTorrentLSDDisabled = torrents[0]->isLSDDisabled();
m_torrentHashes.reserve(torrents.size());
for (const BitTorrent::TorrentHandle *torrent : torrents)
for (const BitTorrent::Torrent *torrent : torrents)
{
m_torrentHashes << torrent->hash();
if (allSameUpLimit)
@ -180,8 +180,8 @@ TorrentOptionsDialog::TorrentOptionsDialog(QWidget *parent, const QVector<BitTor
}
const bool useGlobalValue = allSameRatio && allSameSeedingTime
&& (firstTorrentRatio == BitTorrent::TorrentHandle::USE_GLOBAL_RATIO)
&& (firstTorrentSeedingTime == BitTorrent::TorrentHandle::USE_GLOBAL_SEEDING_TIME);
&& (firstTorrentRatio == BitTorrent::Torrent::USE_GLOBAL_RATIO)
&& (firstTorrentSeedingTime == BitTorrent::Torrent::USE_GLOBAL_SEEDING_TIME);
if (!allSameRatio || !allSameSeedingTime)
{
@ -193,8 +193,8 @@ TorrentOptionsDialog::TorrentOptionsDialog(QWidget *parent, const QVector<BitTor
{
m_ui->radioUseGlobalShareLimits->setChecked(true);
}
else if ((firstTorrentRatio == BitTorrent::TorrentHandle::NO_RATIO_LIMIT)
&& (firstTorrentSeedingTime == BitTorrent::TorrentHandle::NO_SEEDING_TIME_LIMIT))
else if ((firstTorrentRatio == BitTorrent::Torrent::NO_RATIO_LIMIT)
&& (firstTorrentSeedingTime == BitTorrent::Torrent::NO_SEEDING_TIME_LIMIT))
{
m_ui->radioNoLimit->setChecked(true);
}
@ -288,7 +288,7 @@ void TorrentOptionsDialog::accept()
const auto *session = BitTorrent::Session::instance();
for (const BitTorrent::InfoHash &hash : asConst(m_torrentHashes))
{
BitTorrent::TorrentHandle *torrent = session->findTorrent(hash);
BitTorrent::Torrent *torrent = session->findTorrent(hash);
if (!torrent) continue;
if (m_initialValues.upSpeedLimit != m_ui->spinUploadLimit->value())
@ -324,10 +324,10 @@ qreal TorrentOptionsDialog::getRatio() const
return MIXED_SHARE_LIMITS;
if (m_ui->radioUseGlobalShareLimits->isChecked())
return BitTorrent::TorrentHandle::USE_GLOBAL_RATIO;
return BitTorrent::Torrent::USE_GLOBAL_RATIO;
if (m_ui->radioNoLimit->isChecked() || !m_ui->checkMaxRatio->isChecked())
return BitTorrent::TorrentHandle::NO_RATIO_LIMIT;
return BitTorrent::Torrent::NO_RATIO_LIMIT;
return m_ui->spinRatioLimit->value();
}
@ -338,10 +338,10 @@ int TorrentOptionsDialog::getSeedingTime() const
return MIXED_SHARE_LIMITS;
if (m_ui->radioUseGlobalShareLimits->isChecked())
return BitTorrent::TorrentHandle::USE_GLOBAL_SEEDING_TIME;
return BitTorrent::Torrent::USE_GLOBAL_SEEDING_TIME;
if (m_ui->radioNoLimit->isChecked() || !m_ui->checkMaxTime->isChecked())
return BitTorrent::TorrentHandle::NO_SEEDING_TIME_LIMIT;
return BitTorrent::Torrent::NO_SEEDING_TIME_LIMIT;
return m_ui->spinTimeLimit->value();
}