Skip spurious .toLower() on returns of QUrl::scheme()
QUrl::setScheme() parses and canonicalises the scheme, so that scheme() always returns a lower-case string anyway; no need to .toLower() it. Change-Id: Ied00814b63f159386a42552dcf06346ee56f9f97 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>bb10
parent
c9210d392c
commit
6a2892bdef
|
|
@ -702,7 +702,7 @@ void TorrentView::dragMoveEvent(QDragMoveEvent *event)
|
|||
{
|
||||
// Accept file actions with a '.torrent' extension.
|
||||
QUrl url(event->mimeData()->text());
|
||||
if (url.isValid() && url.scheme().toLower() == "file"
|
||||
if (url.isValid() && url.scheme() == "file"
|
||||
&& url.path().toLower().endsWith(".torrent"))
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ static QByteArray makeCacheKey(QUrl &url, QNetworkProxy *proxy)
|
|||
{
|
||||
QString result;
|
||||
QUrl copy = url;
|
||||
QString scheme = copy.scheme().toLower();
|
||||
QString scheme = copy.scheme();
|
||||
bool isEncrypted = scheme == QLatin1String("https");
|
||||
copy.setPort(copy.port(isEncrypted ? 443 : 80));
|
||||
if (scheme == QLatin1String("preconnect-http")) {
|
||||
|
|
|
|||
|
|
@ -1119,7 +1119,7 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
|
|||
Q_D(QNetworkAccessManager);
|
||||
|
||||
bool isLocalFile = req.url().isLocalFile();
|
||||
QString scheme = req.url().scheme().toLower();
|
||||
QString scheme = req.url().scheme();
|
||||
|
||||
// fast path for GET on file:// URLs
|
||||
// The QNetworkAccessFileBackend will right now only be used for PUT
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ QList<QNetworkCookie> QNetworkCookieJar::cookiesForUrl(const QUrl &url) const
|
|||
Q_D(const QNetworkCookieJar);
|
||||
const QDateTime now = QDateTime::currentDateTimeUtc();
|
||||
QList<QNetworkCookie> result;
|
||||
bool isEncrypted = url.scheme().toLower() == QLatin1String("https");
|
||||
bool isEncrypted = url.scheme() == QLatin1String("https");
|
||||
|
||||
// scan our cookies for something that matches
|
||||
QList<QNetworkCookie>::ConstIterator it = d->allCookies.constBegin(),
|
||||
|
|
|
|||
|
|
@ -628,7 +628,7 @@ void QNetworkReplyHttpImplPrivate::postRequest(const QNetworkRequest &newHttpReq
|
|||
httpRequest.setUrl(url);
|
||||
httpRequest.setRedirectCount(newHttpRequest.maximumRedirectsAllowed());
|
||||
|
||||
QString scheme = url.scheme().toLower();
|
||||
QString scheme = url.scheme();
|
||||
bool ssl = (scheme == QLatin1String("https")
|
||||
|| scheme == QLatin1String("preconnect-https"));
|
||||
q->setAttribute(QNetworkRequest::ConnectionEncryptedAttribute, ssl);
|
||||
|
|
|
|||
|
|
@ -634,7 +634,7 @@ QList<QByteArray> QMacPasteboardMimeFileUri::convertFromMime(const QString &mime
|
|||
QUrl url = urls.at(i).toUrl();
|
||||
if (url.scheme().isEmpty())
|
||||
url.setScheme(QLatin1String("file"));
|
||||
if (url.scheme().toLower() == QLatin1String("file")) {
|
||||
if (url.scheme() == QLatin1String("file")) {
|
||||
if (url.host().isEmpty())
|
||||
url.setHost(QLatin1String("localhost"));
|
||||
url.setPath(url.path().normalized(QString::NormalizationForm_D));
|
||||
|
|
@ -713,7 +713,7 @@ QList<QByteArray> QMacPasteboardMimeUrl::convertFromMime(const QString &mime, QV
|
|||
QUrl url = urls.at(i).toUrl();
|
||||
if (url.scheme().isEmpty())
|
||||
url.setScheme(QLatin1String("file"));
|
||||
if (url.scheme().toLower() == QLatin1String("file")) {
|
||||
if (url.scheme() == QLatin1String("file")) {
|
||||
if (url.host().isEmpty())
|
||||
url.setHost(QLatin1String("localhost"));
|
||||
url.setPath(url.path().normalized(QString::NormalizationForm_D));
|
||||
|
|
|
|||
Loading…
Reference in New Issue