mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 08:48:07 -06:00
Move Utils::Misc::isUrl() function
All usage of this function gets to call Net::DownloadManager eventually.
This commit is contained in:
@@ -29,6 +29,8 @@
|
||||
|
||||
#include "downloadmanager.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QDebug>
|
||||
#include <QNetworkCookie>
|
||||
@@ -210,6 +212,15 @@ bool Net::DownloadManager::deleteCookie(const QNetworkCookie &cookie)
|
||||
return static_cast<NetworkCookieJar *>(m_networkManager.cookieJar())->deleteCookie(cookie);
|
||||
}
|
||||
|
||||
bool Net::DownloadManager::hasSupportedScheme(const QString &url)
|
||||
{
|
||||
const QStringList schemes = instance()->m_networkManager.supportedSchemes();
|
||||
return std::any_of(schemes.cbegin(), schemes.cend(), [&url](const QString &scheme)
|
||||
{
|
||||
return url.startsWith((scheme + QLatin1Char(':')), Qt::CaseInsensitive);
|
||||
});
|
||||
}
|
||||
|
||||
void Net::DownloadManager::applyProxySettings()
|
||||
{
|
||||
auto proxyManager = ProxyConfigurationManager::instance();
|
||||
|
||||
@@ -103,6 +103,8 @@ namespace Net
|
||||
void setAllCookies(const QList<QNetworkCookie> &cookieList);
|
||||
bool deleteCookie(const QNetworkCookie &cookie);
|
||||
|
||||
static bool hasSupportedScheme(const QString &url);
|
||||
|
||||
private slots:
|
||||
#ifndef QT_NO_OPENSSL
|
||||
void ignoreSslErrors(QNetworkReply *, const QList<QSslError> &);
|
||||
|
||||
Reference in New Issue
Block a user