summaryrefslogtreecommitdiffstats
path: root/src/network/kernel/qnetworkproxy_win.cpp
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-04-12 14:01:55 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2022-04-21 23:53:15 +0200
commitf2637e1a77a5965a23e54c07587885f5a04ec877 (patch)
tree4564a5c63987750fb10da013b332aefe4a8825c7 /src/network/kernel/qnetworkproxy_win.cpp
parente2a13299101d27800d3d1d88b91635e66d52d5c0 (diff)
QtNetwork: stop using QLatin1Char constructor for creating char literals
Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. As a drive-by, fix qsizetype -> int narrowing conversion warnings for the touched lines. Change-Id: I121f87214b77aeab1dfd3e62dc5adaa6255cc0e0 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/network/kernel/qnetworkproxy_win.cpp')
-rw-r--r--src/network/kernel/qnetworkproxy_win.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/network/kernel/qnetworkproxy_win.cpp b/src/network/kernel/qnetworkproxy_win.cpp
index 514b26adc9c..272aac6b1e6 100644
--- a/src/network/kernel/qnetworkproxy_win.cpp
+++ b/src/network/kernel/qnetworkproxy_win.cpp
@@ -82,11 +82,11 @@ static bool currentProcessIsService()
static QStringList splitSpaceSemicolon(const QString &source)
{
QStringList list;
- int start = 0;
- int end;
+ qsizetype start = 0;
+ qsizetype end;
while (true) {
- int space = source.indexOf(QLatin1Char(' '), start);
- int semicolon = source.indexOf(QLatin1Char(';'), start);
+ qsizetype space = source.indexOf(u' ', start);
+ qsizetype semicolon = source.indexOf(u';', start);
end = space;
if (semicolon != -1 && (end == -1 || semicolon < end))
end = semicolon;
@@ -108,7 +108,7 @@ static bool isBypassed(const QString &host, const QStringList &bypassList)
if (host.isEmpty())
return false;
- bool isSimple = !host.contains(QLatin1Char('.')) && !host.contains(QLatin1Char(':'));
+ bool isSimple = !host.contains(u'.') && !host.contains(u':');
QHostAddress ipAddress;
bool isIpAddress = ipAddress.setAddress(host);
@@ -219,12 +219,12 @@ static QList<QNetworkProxy> parseServerList(const QNetworkProxyQuery &query, con
&& query.queryType() != QNetworkProxyQuery::TcpServer
&& query.queryType() != QNetworkProxyQuery::SctpServer;
for (const QString &entry : proxyList) {
- int server = 0;
+ qsizetype server = 0;
QNetworkProxy::ProxyType proxyType = QNetworkProxy::HttpProxy;
quint16 port = 8080;
- int pos = entry.indexOf(QLatin1Char('='));
+ qsizetype pos = entry.indexOf(u'=');
QStringView scheme;
QStringView protocolTag;
if (pos != -1) {
@@ -253,7 +253,7 @@ static QList<QNetworkProxy> parseServerList(const QNetworkProxyQuery &query, con
}
}
- pos = entry.indexOf(QLatin1Char(':'), server);
+ pos = entry.indexOf(u':', server);
if (pos != -1) {
bool ok;
uint value = QStringView{entry}.mid(pos + 1).toUInt(&ok);