From 413bec8e5d1a60f965abece7f6901fd0a177161d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kimmo=20Kotaj=C3=A4rvi?= Date: Fri, 5 Mar 2010 17:10:48 +0100 Subject: Allow empty authority in QUrl::setAuthority as per docs. Merge-request: 482 Reviewed-by: Thiago Macieira --- src/corelib/io/qurl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 626bd3f..a60f206 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -3479,8 +3479,12 @@ QString QUrlPrivate::authority(QUrl::FormattingOptions options) const void QUrlPrivate::setAuthority(const QString &auth) { - if (auth.isEmpty()) + if (auth.isEmpty()) { + setUserInfo(QString()); + host.clear(); + port = -1; return; + } // find the port section of the authority by searching from the // end towards the beginning for numbers until a ':' is reached. -- cgit v0.12