mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-24 05:25:37 +00:00
commit
f86c5442aa
@ -261,7 +261,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
return app->exec(params.paramList());
|
||||
}
|
||||
catch (CommandLineParameterError &er) {
|
||||
catch (const CommandLineParameterError &er) {
|
||||
displayBadArgMessage(er.messageForUser());
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ namespace Algorithm
|
||||
// To be used with associative array types, such as QMap, QHash and it's variants
|
||||
template <typename T, typename BinaryPredicate
|
||||
, typename std::enable_if_t<HasMappedType<T>::value, int> = 0>
|
||||
void removeIf(T &dict, BinaryPredicate p)
|
||||
void removeIf(T &dict, BinaryPredicate &&p)
|
||||
{
|
||||
auto it = dict.begin();
|
||||
while (it != dict.end())
|
||||
@ -60,7 +60,7 @@ namespace Algorithm
|
||||
// To be used with set types, such as QSet, std::set
|
||||
template <typename T, typename UnaryPredicate
|
||||
, typename std::enable_if_t<!HasMappedType<T>::value, int> = 0>
|
||||
void removeIf(T &set, UnaryPredicate p)
|
||||
void removeIf(T &set, UnaryPredicate &&p)
|
||||
{
|
||||
auto it = set.begin();
|
||||
while (it != set.end())
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <libtorrent/sha1_hash.hpp>
|
||||
|
||||
#include <QRegularExpression>
|
||||
#include <QUrl>
|
||||
|
||||
#include "infohash.h"
|
||||
|
||||
|
@ -29,15 +29,16 @@
|
||||
#ifndef BITTORRENT_MAGNETURI_H
|
||||
#define BITTORRENT_MAGNETURI_H
|
||||
|
||||
#include <libtorrent/add_torrent_params.hpp>
|
||||
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
#include <QUrl>
|
||||
|
||||
#include <libtorrent/add_torrent_params.hpp>
|
||||
|
||||
#include "infohash.h"
|
||||
#include "trackerentry.h"
|
||||
|
||||
class QUrl;
|
||||
|
||||
namespace BitTorrent
|
||||
{
|
||||
class MagnetUri
|
||||
|
@ -29,12 +29,12 @@
|
||||
#ifndef BITTORRENT_PEERINFO_H
|
||||
#define BITTORRENT_PEERINFO_H
|
||||
|
||||
#include <libtorrent/peer_info.hpp>
|
||||
|
||||
#include <QBitArray>
|
||||
#include <QCoreApplication>
|
||||
#include <QHostAddress>
|
||||
|
||||
#include <libtorrent/peer_info.hpp>
|
||||
|
||||
namespace BitTorrent
|
||||
{
|
||||
class TorrentHandle;
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
#include <QDate>
|
||||
#include <QTime>
|
||||
#include <QTimer>
|
||||
|
||||
#include "base/preferences.h"
|
||||
|
||||
|
@ -245,7 +245,7 @@ int FilterParserThread::parseDATFilterFile()
|
||||
m_filter.add_rule(startAddr, endAddr, lt::ip_filter::blocked);
|
||||
++ruleCount;
|
||||
}
|
||||
catch (std::exception &e) {
|
||||
catch (const std::exception &e) {
|
||||
++parseErrorCount;
|
||||
addLog(tr("IP filter exception thrown for line %1. Exception is: %2")
|
||||
.arg(nbLine).arg(QString::fromLocal8Bit(e.what())));
|
||||
@ -383,7 +383,7 @@ int FilterParserThread::parseP2PFilterFile()
|
||||
m_filter.add_rule(startAddr, endAddr, lt::ip_filter::blocked);
|
||||
++ruleCount;
|
||||
}
|
||||
catch (std::exception &e) {
|
||||
catch (const std::exception &e) {
|
||||
++parseErrorCount;
|
||||
addLog(tr("IP filter exception thrown for line %1. Exception is: %2")
|
||||
.arg(nbLine).arg(QString::fromLocal8Bit(e.what())));
|
||||
@ -468,7 +468,7 @@ int FilterParserThread::parseP2BFilterFile()
|
||||
m_filter.add_rule(first, last, lt::ip_filter::blocked);
|
||||
++ruleCount;
|
||||
}
|
||||
catch (std::exception &) {}
|
||||
catch (const std::exception &) {}
|
||||
}
|
||||
}
|
||||
else if (version == 3) {
|
||||
@ -518,7 +518,7 @@ int FilterParserThread::parseP2BFilterFile()
|
||||
m_filter.add_rule(first, last, lt::ip_filter::blocked);
|
||||
++ruleCount;
|
||||
}
|
||||
catch (std::exception &) {}
|
||||
catch (const std::exception &) {}
|
||||
|
||||
if (m_abort) return ruleCount;
|
||||
}
|
||||
@ -577,7 +577,7 @@ void FilterParserThread::run()
|
||||
try {
|
||||
emit IPFilterParsed(ruleCount);
|
||||
}
|
||||
catch (std::exception &) {
|
||||
catch (const std::exception &) {
|
||||
emit IPFilterError();
|
||||
}
|
||||
|
||||
|
@ -29,10 +29,10 @@
|
||||
#ifndef FILTERPARSERTHREAD_H
|
||||
#define FILTERPARSERTHREAD_H
|
||||
|
||||
#include <QThread>
|
||||
|
||||
#include <libtorrent/ip_filter.hpp>
|
||||
|
||||
#include <QThread>
|
||||
|
||||
class QDataStream;
|
||||
|
||||
class FilterParserThread : public QThread
|
||||
|
@ -28,10 +28,10 @@
|
||||
|
||||
#include "portforwarderimpl.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include <libtorrent/session.hpp>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include "base/logger.h"
|
||||
#include "base/settingsstorage.h"
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include "resumedatasavingmanager.h"
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QDebug>
|
||||
#include <QSaveFile>
|
||||
|
||||
|
@ -28,10 +28,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QDir>
|
||||
#include <QObject>
|
||||
|
||||
class QByteArray;
|
||||
|
||||
class ResumeDataSavingManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -1400,7 +1400,7 @@ void Session::configurePeerClasses()
|
||||
, lt::address_v6::from_string("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff")
|
||||
, 1 << lt::session::global_peer_class_id);
|
||||
}
|
||||
catch (std::exception &) {}
|
||||
catch (const std::exception &) {}
|
||||
#endif // TORRENT_USE_IPV6
|
||||
if (ignoreLimitsOnLAN()) {
|
||||
// local networks
|
||||
@ -1439,7 +1439,7 @@ void Session::configurePeerClasses()
|
||||
, lt::address_v6::from_string("::1")
|
||||
, 1 << lt::session::local_peer_class_id);
|
||||
}
|
||||
catch (std::exception &) {}
|
||||
catch (const std::exception &) {}
|
||||
#endif // TORRENT_USE_IPV6
|
||||
}
|
||||
m_nativeSession->set_peer_class_filter(f);
|
||||
@ -1870,7 +1870,7 @@ bool Session::addTorrent_impl(CreateTorrentParams params, const MagnetUri &magne
|
||||
#endif
|
||||
handle.pause();
|
||||
}
|
||||
catch (std::exception &) {}
|
||||
catch (const std::exception &) {}
|
||||
|
||||
adjustLimits();
|
||||
|
||||
@ -3856,7 +3856,7 @@ void Session::handleAlert(const lt::alert *a)
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (std::exception &exc) {
|
||||
catch (const std::exception &exc) {
|
||||
qWarning() << "Caught exception in " << Q_FUNC_INFO << ": " << QString::fromStdString(exc.what());
|
||||
}
|
||||
}
|
||||
@ -4374,7 +4374,7 @@ namespace
|
||||
try {
|
||||
handle.queue_position_up();
|
||||
}
|
||||
catch (std::exception &exc) {
|
||||
catch (const std::exception &exc) {
|
||||
qDebug() << Q_FUNC_INFO << " fails: " << exc.what();
|
||||
}
|
||||
}
|
||||
@ -4384,7 +4384,7 @@ namespace
|
||||
try {
|
||||
handle.queue_position_down();
|
||||
}
|
||||
catch (std::exception &exc) {
|
||||
catch (const std::exception &exc) {
|
||||
qDebug() << Q_FUNC_INFO << " fails: " << exc.what();
|
||||
}
|
||||
}
|
||||
@ -4394,7 +4394,7 @@ namespace
|
||||
try {
|
||||
handle.queue_position_top();
|
||||
}
|
||||
catch (std::exception &exc) {
|
||||
catch (const std::exception &exc) {
|
||||
qDebug() << Q_FUNC_INFO << " fails: " << exc.what();
|
||||
}
|
||||
}
|
||||
@ -4404,7 +4404,7 @@ namespace
|
||||
try {
|
||||
handle.queue_position_bottom();
|
||||
}
|
||||
catch (std::exception &exc) {
|
||||
catch (const std::exception &exc) {
|
||||
qDebug() << Q_FUNC_INFO << " fails: " << exc.what();
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,6 @@
|
||||
#include <QSet>
|
||||
|
||||
#include "base/settingvalue.h"
|
||||
#include "base/tristatebool.h"
|
||||
#include "base/types.h"
|
||||
#include "addtorrentparams.h"
|
||||
#include "cachestatus.h"
|
||||
|
@ -1174,10 +1174,8 @@ QBitArray TorrentHandle::downloadingPieces() const
|
||||
std::vector<lt::partial_piece_info> queue;
|
||||
m_nativeHandle.get_download_queue(queue);
|
||||
|
||||
std::vector<lt::partial_piece_info>::const_iterator it = queue.begin();
|
||||
std::vector<lt::partial_piece_info>::const_iterator itend = queue.end();
|
||||
for (; it != itend; ++it)
|
||||
result.setBit(it->piece_index);
|
||||
for (const lt::partial_piece_info &info : queue)
|
||||
result.setBit(info.piece_index);
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -1577,8 +1575,7 @@ void TorrentHandle::handleTrackerReplyAlert(const lt::tracker_reply_alert *p)
|
||||
const QString trackerUrl(p->tracker_url());
|
||||
qDebug("Received a tracker reply from %s (Num_peers = %d)", qUtf8Printable(trackerUrl), p->num_peers);
|
||||
// Connection was successful now. Remove possible old errors
|
||||
m_trackerInfos[trackerUrl].lastMessage.clear(); // Reset error/warning message
|
||||
m_trackerInfos[trackerUrl].numPeers = p->num_peers;
|
||||
m_trackerInfos[trackerUrl] = {{}, p->num_peers};
|
||||
|
||||
m_session->handleTorrentTrackerReply(this, trackerUrl);
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ namespace BitTorrent
|
||||
struct TrackerInfo
|
||||
{
|
||||
QString lastMessage;
|
||||
quint32 numPeers = 0;
|
||||
int numPeers = 0;
|
||||
};
|
||||
|
||||
enum class TorrentState
|
||||
|
@ -29,7 +29,6 @@
|
||||
#ifndef BITTORRENT_TORRENTINFO_H
|
||||
#define BITTORRENT_TORRENTINFO_H
|
||||
|
||||
#include <libtorrent/fwd.hpp>
|
||||
#include <libtorrent/torrent_info.hpp>
|
||||
#include <libtorrent/version.hpp>
|
||||
|
||||
|
@ -32,9 +32,11 @@
|
||||
#include <QDir>
|
||||
#include <QFileSystemWatcher>
|
||||
#include <QHash>
|
||||
#include <QStringList>
|
||||
#include <QList>
|
||||
#include <QTimer>
|
||||
|
||||
class QStringList;
|
||||
|
||||
/*
|
||||
* Subclassing QFileSystemWatcher in order to support Network File
|
||||
* System watching (NFS, CIFS) on Linux and Mac OS.
|
||||
|
@ -253,7 +253,7 @@ bool RequestParser::parsePostMessage(const QByteArray &data)
|
||||
|
||||
// split data by "dash-boundary"
|
||||
const QByteArray dashDelimiter = QByteArray("--") + delimiter + CRLF;
|
||||
QList<QByteArray> multipart = splitToViews(data, dashDelimiter, QString::SkipEmptyParts);
|
||||
QVector<QByteArray> multipart = splitToViews(data, dashDelimiter, QString::SkipEmptyParts);
|
||||
if (multipart.isEmpty()) {
|
||||
qWarning() << Q_FUNC_INFO << "multipart empty";
|
||||
return false;
|
||||
@ -275,7 +275,7 @@ bool RequestParser::parsePostMessage(const QByteArray &data)
|
||||
|
||||
bool RequestParser::parseFormData(const QByteArray &data)
|
||||
{
|
||||
const QList<QByteArray> list = splitToViews(data, EOH, QString::KeepEmptyParts);
|
||||
const QVector<QByteArray> list = splitToViews(data, EOH, QString::KeepEmptyParts);
|
||||
|
||||
if (list.size() != 2) {
|
||||
qWarning() << Q_FUNC_INFO << "multipart/form-data format error";
|
||||
|
@ -31,7 +31,8 @@
|
||||
#define ICONPROVIDER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
class QString;
|
||||
|
||||
class IconProvider : public QObject
|
||||
{
|
||||
|
@ -33,10 +33,12 @@
|
||||
#include "smtp.h"
|
||||
|
||||
#include <QCryptographicHash>
|
||||
#include <QDateTime>
|
||||
#include <QDebug>
|
||||
#include <QHostInfo>
|
||||
#include <QStringList>
|
||||
#include <QTextCodec>
|
||||
|
||||
#ifndef QT_NO_OPENSSL
|
||||
#include <QSslSocket>
|
||||
#else
|
||||
|
@ -29,9 +29,21 @@
|
||||
|
||||
#include "preferences.h"
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#endif
|
||||
#ifdef Q_OS_WIN
|
||||
#include <shlobj.h>
|
||||
#endif
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QDir>
|
||||
#include <QLocale>
|
||||
#include <QNetworkCookie>
|
||||
#include <QSettings>
|
||||
#include <QSize>
|
||||
#include <QTime>
|
||||
#include <QVariant>
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
#include <QApplication>
|
||||
@ -40,14 +52,9 @@
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <shlobj.h>
|
||||
#include <QRegularExpression>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#endif
|
||||
|
||||
#include "algorithm.h"
|
||||
#include "global.h"
|
||||
#include "settingsstorage.h"
|
||||
|
@ -30,16 +30,17 @@
|
||||
#ifndef PREFERENCES_H
|
||||
#define PREFERENCES_H
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QList>
|
||||
#include <QNetworkCookie>
|
||||
#include <QSize>
|
||||
#include <QStringList>
|
||||
#include <QTime>
|
||||
#include <QVariant>
|
||||
|
||||
#include "base/utils/net.h"
|
||||
|
||||
class QDateTime;
|
||||
class QNetworkCookie;
|
||||
class QSize;
|
||||
class QTime;
|
||||
class QVariant;
|
||||
|
||||
enum SchedulerDays
|
||||
{
|
||||
EVERY_DAY,
|
||||
@ -74,8 +75,6 @@ namespace DNS
|
||||
};
|
||||
}
|
||||
|
||||
class SettingsStorage;
|
||||
|
||||
class Preferences : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -31,8 +31,6 @@
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
#include "base/utils/fs.h"
|
||||
|
||||
Private::Profile::Profile(const QString &configurationName)
|
||||
: m_configurationSuffix {configurationName.isEmpty() ? QString() : QLatin1Char('_') + configurationName}
|
||||
{
|
||||
|
@ -33,8 +33,8 @@
|
||||
#include <memory>
|
||||
|
||||
#include <QSettings>
|
||||
#include <QString>
|
||||
|
||||
class QString;
|
||||
class Application;
|
||||
|
||||
namespace Private
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include <QSaveFile>
|
||||
#include <QThread>
|
||||
#include <QTimer>
|
||||
#include <QUrl>
|
||||
#include <QVariant>
|
||||
#include <QVector>
|
||||
|
||||
|
@ -29,10 +29,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QSharedDataPointer>
|
||||
#include <QVariant>
|
||||
|
||||
class QDateTime;
|
||||
class QJsonObject;
|
||||
class QRegularExpression;
|
||||
class TriStateBool;
|
||||
|
@ -341,7 +341,7 @@ void ScanFoldersModel::configure()
|
||||
{
|
||||
const QVariantHash dirs = Preferences::instance()->getScanDirs();
|
||||
|
||||
for (QVariantHash::const_iterator i = dirs.begin(), e = dirs.end(); i != e; ++i) {
|
||||
for (auto i = dirs.cbegin(); i != dirs.cend(); ++i) {
|
||||
if (i.value().type() == QVariant::Int)
|
||||
addPath(i.key(), static_cast<PathType>(i.value().toInt()), QString());
|
||||
else
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <QByteArray>
|
||||
#include <QList>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
class QProcess;
|
||||
class QTimer;
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include <QDomDocument>
|
||||
#include <QDomElement>
|
||||
#include <QDomNode>
|
||||
#include <QList>
|
||||
#include <QPointer>
|
||||
#include <QProcess>
|
||||
|
||||
@ -494,13 +493,13 @@ void SearchPluginManager::parseVersionInfo(const QByteArray &info)
|
||||
QHash<QString, PluginVersion> updateInfo;
|
||||
int numCorrectData = 0;
|
||||
|
||||
const QList<QByteArray> lines = Utils::ByteArray::splitToViews(info, "\n", QString::SkipEmptyParts);
|
||||
const QVector<QByteArray> lines = Utils::ByteArray::splitToViews(info, "\n", QString::SkipEmptyParts);
|
||||
for (QByteArray line : lines) {
|
||||
line = line.trimmed();
|
||||
if (line.isEmpty()) continue;
|
||||
if (line.startsWith('#')) continue;
|
||||
|
||||
const QList<QByteArray> list = Utils::ByteArray::splitToViews(line, ":", QString::SkipEmptyParts);
|
||||
const QVector<QByteArray> list = Utils::ByteArray::splitToViews(line, ":", QString::SkipEmptyParts);
|
||||
if (list.size() != 2) continue;
|
||||
|
||||
const QString pluginName = list.first().trimmed();
|
||||
|
@ -33,7 +33,6 @@
|
||||
|
||||
#include <QMetaEnum>
|
||||
#include <QString>
|
||||
#include <QVariant>
|
||||
|
||||
#include "settingsstorage.h"
|
||||
|
||||
@ -51,7 +50,7 @@ public:
|
||||
// T proxyFunc(const T &a);
|
||||
template <typename ProxyFunc>
|
||||
explicit CachedSettingValue(const char *keyName, const T &defaultValue
|
||||
, ProxyFunc proxyFunc)
|
||||
, ProxyFunc &&proxyFunc)
|
||||
: m_keyName(QLatin1String(keyName))
|
||||
, m_value(proxyFunc(loadValue(defaultValue)))
|
||||
{
|
||||
|
@ -28,15 +28,17 @@
|
||||
|
||||
#include "bytearray.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QByteArray>
|
||||
|
||||
QList<QByteArray> Utils::ByteArray::splitToViews(const QByteArray &in, const QByteArray &sep, const QString::SplitBehavior behavior)
|
||||
QVector<QByteArray> Utils::ByteArray::splitToViews(const QByteArray &in, const QByteArray &sep, const QString::SplitBehavior behavior)
|
||||
{
|
||||
if (sep.isEmpty())
|
||||
return {in};
|
||||
|
||||
QList<QByteArray> ret;
|
||||
|
||||
QVector<QByteArray> ret;
|
||||
ret.reserve((behavior == QString::KeepEmptyParts)
|
||||
? (1 + (in.size() / sep.size()))
|
||||
: (1 + (in.size() / (sep.size() + 1))));
|
||||
int head = 0;
|
||||
while (head < in.size()) {
|
||||
int end = in.indexOf(sep, head);
|
||||
|
@ -28,15 +28,17 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
class QByteArray;
|
||||
|
||||
namespace Utils
|
||||
{
|
||||
namespace ByteArray
|
||||
{
|
||||
// Mimic QString::split(sep, behavior)
|
||||
QList<QByteArray> splitToViews(const QByteArray &in, const QByteArray &sep, const QString::SplitBehavior behavior = QString::KeepEmptyParts);
|
||||
// Mimic QString::splitRef(sep, behavior)
|
||||
QVector<QByteArray> splitToViews(const QByteArray &in, const QByteArray &sep, const QString::SplitBehavior behavior = QString::KeepEmptyParts);
|
||||
|
||||
// Mimic QByteArray::mid(pos, len) but instead of returning a full-copy,
|
||||
// we only return a partial view
|
||||
|
@ -43,6 +43,7 @@
|
||||
#endif
|
||||
|
||||
#include "base/logger.h"
|
||||
#include "base/utils/bytearray.h"
|
||||
|
||||
using namespace Utils::ForeignApps;
|
||||
|
||||
@ -61,7 +62,7 @@ namespace
|
||||
// Software 'Anaconda' installs its own python interpreter
|
||||
// and `python --version` returns a string like this:
|
||||
// "Python 3.4.3 :: Anaconda 2.3.0 (64-bit)"
|
||||
const QList<QByteArray> outputSplit = procOutput.split(' ');
|
||||
const QVector<QByteArray> outputSplit = Utils::ByteArray::splitToViews(procOutput, " ", QString::SkipEmptyParts);
|
||||
if (outputSplit.size() <= 1)
|
||||
return false;
|
||||
|
||||
|
@ -34,15 +34,6 @@
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QDirIterator>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QStorageInfo>
|
||||
#include <QRegularExpression>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
@ -58,6 +49,15 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QDirIterator>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QStorageInfo>
|
||||
#include <QRegularExpression>
|
||||
|
||||
#include "base/bittorrent/torrenthandle.h"
|
||||
#include "base/global.h"
|
||||
|
||||
|
@ -28,9 +28,6 @@
|
||||
|
||||
#include "misc.h"
|
||||
|
||||
#include <boost/version.hpp>
|
||||
#include <libtorrent/version.hpp>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <windows.h>
|
||||
#include <Shlobj.h>
|
||||
@ -44,7 +41,9 @@
|
||||
#include <CoreServices/CoreServices.h>
|
||||
#endif
|
||||
|
||||
#include <boost/version.hpp>
|
||||
#include <openssl/opensslv.h>
|
||||
#include <libtorrent/version.hpp>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QRegularExpression>
|
||||
@ -361,30 +360,6 @@ QString Utils::Misc::getUserIDString()
|
||||
return uid;
|
||||
}
|
||||
|
||||
QStringList Utils::Misc::toStringList(const QList<bool> &l)
|
||||
{
|
||||
QStringList ret;
|
||||
for (const bool b : l)
|
||||
ret << (b ? "1" : "0");
|
||||
return ret;
|
||||
}
|
||||
|
||||
QList<int> Utils::Misc::intListfromStringList(const QStringList &l)
|
||||
{
|
||||
QList<int> ret;
|
||||
for (const QString &s : l)
|
||||
ret << s.toInt();
|
||||
return ret;
|
||||
}
|
||||
|
||||
QList<bool> Utils::Misc::boolListfromStringList(const QStringList &l)
|
||||
{
|
||||
QList<bool> ret;
|
||||
for (const QString &s : l)
|
||||
ret << (s == "1");
|
||||
return ret;
|
||||
}
|
||||
|
||||
QString Utils::Misc::parseHtmlLinks(const QString &rawText)
|
||||
{
|
||||
QString result = rawText;
|
||||
|
@ -36,9 +36,7 @@
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
class QString;
|
||||
enum class ShutdownDialogAction;
|
||||
|
||||
/* Miscellaneous functions that can be useful */
|
||||
@ -87,11 +85,6 @@ namespace Utils
|
||||
QString userFriendlyDuration(qlonglong seconds);
|
||||
QString getUserIDString();
|
||||
|
||||
// Convert functions
|
||||
QStringList toStringList(const QList<bool> &l);
|
||||
QList<int> intListfromStringList(const QStringList &l);
|
||||
QList<bool> boolListfromStringList(const QStringList &l);
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
QString windowsSystemPath();
|
||||
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include <openssl/evp.h>
|
||||
|
||||
#include <QByteArray>
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
|
||||
#include "bytearray.h"
|
||||
@ -99,7 +98,7 @@ bool Utils::Password::PBKDF2::verify(const QByteArray &secret, const QString &pa
|
||||
|
||||
bool Utils::Password::PBKDF2::verify(const QByteArray &secret, const QByteArray &password)
|
||||
{
|
||||
const QList<QByteArray> list = ByteArray::splitToViews(secret, ":", QString::SkipEmptyParts);
|
||||
const QVector<QByteArray> list = ByteArray::splitToViews(secret, ":", QString::SkipEmptyParts);
|
||||
if (list.size() != 2)
|
||||
return false;
|
||||
|
||||
|
@ -43,6 +43,8 @@
|
||||
#include <cstdio>
|
||||
#endif
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include "misc.h"
|
||||
|
||||
namespace
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "optionsdialog.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <limits>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCloseEvent>
|
||||
@ -62,8 +63,8 @@
|
||||
#include "advancedsettings.h"
|
||||
#include "app/application.h"
|
||||
#include "banlistoptionsdialog.h"
|
||||
#include "ipsubnetwhitelistoptionsdialog.h"
|
||||
#include "guiiconprovider.h"
|
||||
#include "ipsubnetwhitelistoptionsdialog.h"
|
||||
#include "rss/automatedrssdownloader.h"
|
||||
#include "scanfoldersdelegate.h"
|
||||
#include "ui_optionsdialog.h"
|
||||
@ -297,7 +298,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
|
||||
.arg(tr("Supported parameters (case sensitive):")
|
||||
, tr("%N: Torrent name")
|
||||
, tr("%L: Category")
|
||||
, tr("%G: Tags (seperated by comma)")
|
||||
, tr("%G: Tags (separated by comma)")
|
||||
, tr("%F: Content path (same as root path for multifile torrent)")
|
||||
, tr("%R: Root path (first torrent subdirectory path)")
|
||||
, tr("%D: Save path")
|
||||
|
@ -29,7 +29,6 @@
|
||||
#ifndef OPTIONSDIALOG_H
|
||||
#define OPTIONSDIALOG_H
|
||||
|
||||
#include <QButtonGroup>
|
||||
#include <QDialog>
|
||||
|
||||
class QAbstractButton;
|
||||
|
@ -29,12 +29,14 @@
|
||||
#include "propertieswidget.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QDateTime>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QHeaderView>
|
||||
#include <QListWidgetItem>
|
||||
#include <QMenu>
|
||||
#include <QSplitter>
|
||||
#include <QShortcut>
|
||||
#include <QStackedWidget>
|
||||
#include <QThread>
|
||||
#include <QUrl>
|
||||
|
@ -29,14 +29,13 @@
|
||||
#ifndef PROPERTIESWIDGET_H
|
||||
#define PROPERTIESWIDGET_H
|
||||
|
||||
#include <QShortcut>
|
||||
#include <QList>
|
||||
#include <QWidget>
|
||||
|
||||
#include "base/bittorrent/torrenthandle.h"
|
||||
|
||||
class QAction;
|
||||
class QPushButton;
|
||||
class QTimer;
|
||||
class QShortcut;
|
||||
class QTreeView;
|
||||
|
||||
class DownloadedPiecesBar;
|
||||
@ -45,8 +44,6 @@ class PeerListWidget;
|
||||
class PieceAvailabilityBar;
|
||||
class PropListDelegate;
|
||||
class PropTabBar;
|
||||
class SpeedWidget;
|
||||
class torrent_file;
|
||||
class TorrentContentFilterModel;
|
||||
class TrackerListWidget;
|
||||
|
||||
|
@ -28,13 +28,12 @@
|
||||
|
||||
#include "speedwidget.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QDateTime>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QMenu>
|
||||
#include <QTimer>
|
||||
|
||||
#include <libtorrent/session_status.hpp>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "base/bittorrent/session.h"
|
||||
#include "base/bittorrent/sessionstatus.h"
|
||||
|
@ -34,10 +34,10 @@
|
||||
|
||||
#include "speedplotview.h"
|
||||
|
||||
class QVBoxLayout;
|
||||
class QHBoxLayout;
|
||||
class QLabel;
|
||||
class QMenu;
|
||||
class QVBoxLayout;
|
||||
class PropertiesWidget;
|
||||
|
||||
class ComboBoxMenuButton : public QComboBox
|
||||
|
@ -69,9 +69,8 @@ void TorrentContentTreeView::keyPressEvent(QKeyEvent *event)
|
||||
|
||||
const QModelIndexList selection = selectionModel()->selectedRows(TorrentContentModelItem::COL_NAME);
|
||||
|
||||
for (QModelIndexList::const_iterator i = selection.begin(); i != selection.end(); ++i) {
|
||||
QModelIndex index = *i;
|
||||
Q_ASSERT(i->column() == TorrentContentModelItem::COL_NAME);
|
||||
for (const QModelIndex &index : selection) {
|
||||
Q_ASSERT(index.column() == TorrentContentModelItem::COL_NAME);
|
||||
model()->setData(index, state, Qt::CheckStateRole);
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "transferlistdelegate.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDateTime>
|
||||
#include <QModelIndex>
|
||||
#include <QPainter>
|
||||
#include <QStyleOptionViewItem>
|
||||
@ -37,7 +38,6 @@
|
||||
#include <QProxyStyle>
|
||||
#endif
|
||||
|
||||
#include "base/bittorrent/session.h"
|
||||
#include "base/bittorrent/torrenthandle.h"
|
||||
#include "base/preferences.h"
|
||||
#include "base/types.h"
|
||||
|
@ -112,7 +112,7 @@ void AppController::preferencesAction()
|
||||
// Automatically add torrents from
|
||||
const QVariantHash dirs = pref->getScanDirs();
|
||||
QVariantMap nativeDirs;
|
||||
for (QVariantHash::const_iterator i = dirs.cbegin(), e = dirs.cend(); i != e; ++i) {
|
||||
for (auto i = dirs.cbegin(); i != dirs.cend(); ++i) {
|
||||
if (i.value().type() == QVariant::Int)
|
||||
nativeDirs.insert(Utils::Fs::toNativePath(i.key()), i.value().toInt());
|
||||
else
|
||||
@ -299,7 +299,7 @@ void AppController::setPreferencesAction()
|
||||
QVariantHash oldScanDirs = pref->getScanDirs();
|
||||
QVariantHash scanDirs;
|
||||
ScanFoldersModel *model = ScanFoldersModel::instance();
|
||||
for (QVariantMap::const_iterator i = nativeDirs.cbegin(), e = nativeDirs.cend(); i != e; ++i) {
|
||||
for (auto i = nativeDirs.cbegin(); i != nativeDirs.cend(); ++i) {
|
||||
QString folder = Utils::Fs::fromNativePath(i.key());
|
||||
int downloadType;
|
||||
QString downloadPath;
|
||||
|
@ -28,6 +28,9 @@
|
||||
|
||||
#include "authcontroller.h"
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QString>
|
||||
|
||||
#include "base/logger.h"
|
||||
#include "base/preferences.h"
|
||||
#include "base/utils/password.h"
|
||||
|
@ -29,10 +29,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <QHash>
|
||||
#include <QString>
|
||||
|
||||
#include "apicontroller.h"
|
||||
|
||||
class QString;
|
||||
|
||||
class AuthController : public APIController
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -29,10 +29,6 @@
|
||||
#include "webapplication.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <queue>
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QDebug>
|
||||
@ -41,13 +37,13 @@
|
||||
#include <QJsonDocument>
|
||||
#include <QMimeDatabase>
|
||||
#include <QMimeType>
|
||||
#include <QNetworkCookie>
|
||||
#include <QRegExp>
|
||||
#include <QUrl>
|
||||
|
||||
#include "base/algorithm.h"
|
||||
#include "base/global.h"
|
||||
#include "base/http/httperror.h"
|
||||
#include "base/iconprovider.h"
|
||||
#include "base/logger.h"
|
||||
#include "base/preferences.h"
|
||||
#include "base/utils/bytearray.h"
|
||||
|
@ -214,7 +214,7 @@
|
||||
<ul>
|
||||
<li>QBT_TR(%N: Torrent name)QBT_TR[CONTEXT=OptionsDialog]</li>
|
||||
<li>QBT_TR(%L: Category)QBT_TR[CONTEXT=OptionsDialog]</li>
|
||||
<li>QBT_TR(%G: Tags (seperated by comma))QBT_TR[CONTEXT=OptionsDialog]</li>
|
||||
<li>QBT_TR(%G: Tags (separated by comma))QBT_TR[CONTEXT=OptionsDialog]</li>
|
||||
<li>QBT_TR(%F: Content path (same as root path for multifile torrent))QBT_TR[CONTEXT=OptionsDialog]</li>
|
||||
<li>QBT_TR(%R: Root path (first torrent subdirectory path))QBT_TR[CONTEXT=OptionsDialog]</li>
|
||||
<li>QBT_TR(%D: Save path)QBT_TR[CONTEXT=OptionsDialog]</li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user