diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-01-05 18:36:10 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-01-05 18:36:10 (GMT) |
commit | dbc4a07327e0c306eb84a65ae7fa98bdb36c6ad0 (patch) | |
tree | 21ea670935253bb7002a29bea308d0cf9fa78595 /src/corelib/io/qurl.cpp | |
parent | 6abee18b8ab9899b909a15227fba8fbc4506fad8 (diff) | |
parent | 4c486619517cea4012a157995bce197c817d83e5 (diff) | |
download | Qt-dbc4a07327e0c306eb84a65ae7fa98bdb36c6ad0.zip Qt-dbc4a07327e0c306eb84a65ae7fa98bdb36c6ad0.tar.gz Qt-dbc4a07327e0c306eb84a65ae7fa98bdb36c6ad0.tar.bz2 |
Merge branch '4.6'
Conflicts:
src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
Diffstat (limited to 'src/corelib/io/qurl.cpp')
-rw-r--r-- | src/corelib/io/qurl.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index fd51bcf..6ac6468 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -3864,14 +3864,18 @@ QByteArray QUrlPrivate::toEncoded(QUrl::FormattingOptions options) const url += "//"; if ((options & QUrl::RemoveUserInfo) != QUrl::RemoveUserInfo) { + bool hasUserOrPass = false; if (!userName.isEmpty()) { url += encodedUserName; - if (!(options & QUrl::RemovePassword) && !password.isEmpty()) { - url += ':'; - url += encodedPassword; - } - url += '@'; + hasUserOrPass = true; } + if (!(options & QUrl::RemovePassword) && !password.isEmpty()) { + url += ':'; + url += encodedPassword; + hasUserOrPass = true; + } + if (hasUserOrPass) + url += '@'; } if (host.startsWith(QLatin1Char('['))) { |