diff options
Diffstat (limited to 'src/network/kernel/qnetworkproxy_win.cpp')
-rw-r--r-- | src/network/kernel/qnetworkproxy_win.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/network/kernel/qnetworkproxy_win.cpp b/src/network/kernel/qnetworkproxy_win.cpp index 272aac6b1e..53882613f6 100644 --- a/src/network/kernel/qnetworkproxy_win.cpp +++ b/src/network/kernel/qnetworkproxy_win.cpp @@ -57,6 +57,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + static bool currentProcessIsService() { wchar_t userName[UNLEN + 1] = L""; @@ -119,7 +121,7 @@ static bool isBypassed(const QString &host, const QStringList &bypassList) // does it match the list of exclusions? for (const QString &entry : bypassList) { - if (entry == QLatin1String("<local>")) { + if (entry == "<local>"_L1) { if (isSimple) return true; if (isIpAddress) { @@ -231,20 +233,20 @@ static QList<QNetworkProxy> parseServerList(const QNetworkProxyQuery &query, con scheme = protocolTag = QStringView{entry}.left(pos); server = pos + 1; } - pos = entry.indexOf(QLatin1String("://"), server); + pos = entry.indexOf("://"_L1, server); if (pos != -1) { scheme = QStringView{entry}.mid(server, pos - server); server = pos + 3; } if (!scheme.isEmpty()) { - if (scheme == QLatin1String("http") || scheme == QLatin1String("https")) { + if (scheme == "http"_L1 || scheme == "https"_L1) { // no-op // defaults are above - } else if (scheme == QLatin1String("socks") || scheme == QLatin1String("socks5")) { + } else if (scheme == "socks"_L1 || scheme == "socks5"_L1) { proxyType = QNetworkProxy::Socks5Proxy; port = 1080; - } else if (scheme == QLatin1String("ftp")) { + } else if (scheme == "ftp"_L1) { proxyType = QNetworkProxy::FtpCachingProxy; port = 2121; } else { @@ -279,10 +281,10 @@ static QList<QNetworkProxy> parseServerList(const QNetworkProxyQuery &query, con result.prepend(taggedProxies.value(requiredTag)); } } - if (!checkTags || requiredTag != QLatin1String("http")) { + if (!checkTags || requiredTag != "http"_L1) { // if there are different http proxies for http and https, prefer the https one (more likely to be capable of CONNECT) - QNetworkProxy httpProxy = taggedProxies.value(QLatin1String("http")); - QNetworkProxy httpsProxy = taggedProxies.value(QLatin1String("http")); + QNetworkProxy httpProxy = taggedProxies.value("http"_L1); + QNetworkProxy httpsProxy = taggedProxies.value("http"_L1); if (httpProxy != httpsProxy && httpProxy.type() == QNetworkProxy::HttpProxy && httpsProxy.type() == QNetworkProxy::HttpProxy) { for (int i = 0; i < result.count(); i++) { if (httpProxy == result.at(i)) @@ -504,11 +506,11 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro // url could be empty, e.g. from QNetworkProxy::applicationProxy(), that's fine, // we'll still ask for the proxy. // But for a file url, we know we don't need one. - if (url.scheme() == QLatin1String("file") || url.scheme() == QLatin1String("qrc")) + if (url.scheme() == "file"_L1 || url.scheme() == "qrc"_L1) return sp->defaultResult; if (query.queryType() != QNetworkProxyQuery::UrlRequest) { // change the scheme to https, maybe it'll work - url.setScheme(QLatin1String("https")); + url.setScheme("https"_L1); } QString urlQueryString = url.toString(); |