mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 08:48:07 -06:00
committed by
GitHub
parent
d2fceaa228
commit
5ef2a1df07
@@ -32,8 +32,8 @@
|
||||
|
||||
#include <QHash>
|
||||
#include <QJsonDocument>
|
||||
#include <QList>
|
||||
#include <QMetaObject>
|
||||
#include <QVector>
|
||||
|
||||
#include "apierror.h"
|
||||
|
||||
@@ -72,7 +72,7 @@ const DataMap &APIController::data() const
|
||||
return m_data;
|
||||
}
|
||||
|
||||
void APIController::requireParams(const QVector<QString> &requiredParams) const
|
||||
void APIController::requireParams(const QList<QString> &requiredParams) const
|
||||
{
|
||||
const bool hasAllRequiredParams = std::all_of(requiredParams.cbegin(), requiredParams.cend()
|
||||
, [this](const QString &requiredParam)
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
protected:
|
||||
const StringMap ¶ms() const;
|
||||
const DataMap &data() const;
|
||||
void requireParams(const QVector<QString> &requiredParams) const;
|
||||
void requireParams(const QList<QString> &requiredParams) const;
|
||||
|
||||
void setResult(const QString &result);
|
||||
void setResult(const QJsonArray &result);
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
#include <QVector>
|
||||
#include <QList>
|
||||
|
||||
#include "base/global.h"
|
||||
#include "base/logger.h"
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonValue>
|
||||
#include <QVector>
|
||||
#include <QList>
|
||||
|
||||
#include "base/rss/rss_article.h"
|
||||
#include "base/rss/rss_autodownloader.h"
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "serialize_torrent.h"
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QVector>
|
||||
#include <QList>
|
||||
|
||||
#include "base/bittorrent/infohash.h"
|
||||
#include "base/bittorrent/torrent.h"
|
||||
|
||||
@@ -732,7 +732,7 @@ void SyncController::torrentPeersAction()
|
||||
QVariantMap data;
|
||||
QVariantHash peers;
|
||||
|
||||
const QVector<BitTorrent::PeerInfo> peersList = torrent->peers();
|
||||
const QList<BitTorrent::PeerInfo> peersList = torrent->peers();
|
||||
|
||||
bool resolvePeerCountries = Preferences::instance()->resolvePeerCountries();
|
||||
|
||||
@@ -912,7 +912,7 @@ void SyncController::onTorrentTagRemoved(BitTorrent::Torrent *torrent, [[maybe_u
|
||||
m_updatedTorrents.insert(torrent->id());
|
||||
}
|
||||
|
||||
void SyncController::onTorrentsUpdated(const QVector<BitTorrent::Torrent *> &torrents)
|
||||
void SyncController::onTorrentsUpdated(const QList<BitTorrent::Torrent *> &torrents)
|
||||
{
|
||||
for (const BitTorrent::Torrent *torrent : torrents)
|
||||
m_updatedTorrents.insert(torrent->id());
|
||||
@@ -922,7 +922,7 @@ void SyncController::onTorrentTrackersChanged(BitTorrent::Torrent *torrent)
|
||||
{
|
||||
using namespace BitTorrent;
|
||||
|
||||
const QVector<TrackerEntryStatus> trackers = torrent->trackers();
|
||||
const QList<TrackerEntryStatus> trackers = torrent->trackers();
|
||||
|
||||
QSet<QString> currentTrackers;
|
||||
currentTrackers.reserve(trackers.size());
|
||||
|
||||
@@ -77,7 +77,7 @@ private:
|
||||
void onTorrentSavingModeChanged(BitTorrent::Torrent *torrent);
|
||||
void onTorrentTagAdded(BitTorrent::Torrent *torrent, const Tag &tag);
|
||||
void onTorrentTagRemoved(BitTorrent::Torrent *torrent, const Tag &tag);
|
||||
void onTorrentsUpdated(const QVector<BitTorrent::Torrent *> &torrents);
|
||||
void onTorrentsUpdated(const QList<BitTorrent::Torrent *> &torrents);
|
||||
void onTorrentTrackersChanged(BitTorrent::Torrent *torrent);
|
||||
|
||||
qint64 m_freeDiskSpace = 0;
|
||||
|
||||
@@ -242,9 +242,9 @@ namespace
|
||||
return {dht, pex, lsd};
|
||||
}
|
||||
|
||||
QVector<BitTorrent::TorrentID> toTorrentIDs(const QStringList &idStrings)
|
||||
QList<BitTorrent::TorrentID> toTorrentIDs(const QStringList &idStrings)
|
||||
{
|
||||
QVector<BitTorrent::TorrentID> idList;
|
||||
QList<BitTorrent::TorrentID> idList;
|
||||
idList.reserve(idStrings.size());
|
||||
for (const QString &hash : idStrings)
|
||||
idList << BitTorrent::TorrentID::fromString(hash);
|
||||
@@ -576,7 +576,7 @@ void TorrentsController::filesAction()
|
||||
throw APIError(APIErrorType::NotFound);
|
||||
|
||||
const int filesCount = torrent->filesCount();
|
||||
QVector<int> fileIndexes;
|
||||
QList<int> fileIndexes;
|
||||
const auto idxIt = params().constFind(u"indexes"_s);
|
||||
if (idxIt != params().cend())
|
||||
{
|
||||
@@ -604,9 +604,9 @@ void TorrentsController::filesAction()
|
||||
QJsonArray fileList;
|
||||
if (torrent->hasMetadata())
|
||||
{
|
||||
const QVector<BitTorrent::DownloadPriority> priorities = torrent->filePriorities();
|
||||
const QVector<qreal> fp = torrent->filesProgress();
|
||||
const QVector<qreal> fileAvailability = torrent->availableFileFractions();
|
||||
const QList<BitTorrent::DownloadPriority> priorities = torrent->filePriorities();
|
||||
const QList<qreal> fp = torrent->filesProgress();
|
||||
const QList<qreal> fileAvailability = torrent->availableFileFractions();
|
||||
const BitTorrent::TorrentInfo info = torrent->info();
|
||||
for (const int index : asConst(fileIndexes))
|
||||
{
|
||||
@@ -648,7 +648,7 @@ void TorrentsController::pieceHashesAction()
|
||||
QJsonArray pieceHashes;
|
||||
if (torrent->hasMetadata())
|
||||
{
|
||||
const QVector<QByteArray> hashes = torrent->info().pieceHashes();
|
||||
const QList<QByteArray> hashes = torrent->info().pieceHashes();
|
||||
for (const QByteArray &hash : hashes)
|
||||
pieceHashes.append(QString::fromLatin1(hash.toHex()));
|
||||
}
|
||||
@@ -889,7 +889,7 @@ void TorrentsController::addPeersAction()
|
||||
const QStringList hashes = params()[u"hashes"_s].split(u'|');
|
||||
const QStringList peers = params()[u"peers"_s].split(u'|');
|
||||
|
||||
QVector<BitTorrent::PeerAddress> peerList;
|
||||
QList<BitTorrent::PeerAddress> peerList;
|
||||
peerList.reserve(peers.size());
|
||||
for (const QString &peer : peers)
|
||||
{
|
||||
@@ -956,7 +956,7 @@ void TorrentsController::filePrioAction()
|
||||
throw APIError(APIErrorType::Conflict, tr("Torrent's metadata has not yet downloaded"));
|
||||
|
||||
const int filesCount = torrent->filesCount();
|
||||
QVector<BitTorrent::DownloadPriority> priorities = torrent->filePriorities();
|
||||
QList<BitTorrent::DownloadPriority> priorities = torrent->filePriorities();
|
||||
bool priorityChanged = false;
|
||||
for (const QString &fileID : params()[u"id"_s].split(u'|'))
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "transfercontroller.h"
|
||||
|
||||
#include <QJsonObject>
|
||||
#include <QVector>
|
||||
#include <QList>
|
||||
|
||||
#include "base/bittorrent/peeraddress.h"
|
||||
#include "base/bittorrent/peerinfo.h"
|
||||
|
||||
Reference in New Issue
Block a user