diff options
Diffstat (limited to 'src/corelib/io/qurl.cpp')
-rw-r--r-- | src/corelib/io/qurl.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 9607f14853..9f9653ea94 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -1089,8 +1089,11 @@ inline void QUrlPrivate::setQuery(const QString &value, int from, int iend) inline void QUrlPrivate::appendHost(QString &appendTo, QUrl::FormattingOptions options) const { - // this is the only flag that matters - options &= QUrl::EncodeUnicode; + // EncodeUnicode is the only flag that matters + if ((options & QUrl::FullyDecoded) == QUrl::FullyDecoded) + options = 0; + else + options &= QUrl::EncodeUnicode; if (host.isEmpty()) return; if (host.at(0).unicode() == '[') { @@ -3249,8 +3252,8 @@ QUrl QUrl::adjusted(QUrl::FormattingOptions options) const that.setPath(QString()); } else if (options & (StripTrailingSlash | RemoveFilename | NormalizePathSegments)) { QString path; - d->appendPath(path, options, QUrlPrivate::Path); - that.setPath(path); + d->appendPath(path, options | FullyEncoded, QUrlPrivate::Path); + that.setPath(path, TolerantMode); } return that; } @@ -3964,9 +3967,9 @@ uint qHash(const QUrl &url, uint seed) Q_DECL_NOTHROW static QUrl adjustFtpPath(QUrl url) { if (url.scheme() == ftpScheme()) { - QString path = url.path(); + QString path = url.path(QUrl::PrettyDecoded); if (path.startsWith(QLatin1String("//"))) - url.setPath(QLatin1String("/%2F") + path.midRef(2)); + url.setPath(QLatin1String("/%2F") + path.midRef(2), QUrl::TolerantMode); } return url; } |