Ensure proper handling of empty-but-present URL components
authorThiago Macieira <thiago.macieira@intel.com>
Wed, 11 Apr 2012 20:55:18 +0000 (17:55 -0300)
committerQt by Nokia <qt-info@nokia.com>
Thu, 12 Apr 2012 21:01:37 +0000 (23:01 +0200)
commit4d79312f1c3ba04130129d7047aade56cee6c70f
tree918daba527c60887939d3da66478dcb458675ec0
parent5aa8e5a81cfa1b7a45f5b1642d4706962ee821ed
Ensure proper handling of empty-but-present URL components

The new QUrl is able to distinguish a URL component that is empty from
one that is absent. The previous one already had that capability for
the port, fragment and query, and the new one extends that to the username,
password and path. The path did not need this handling because its
delimiter from the authority it part of the path.

For example, a URL with no username is one where it's set to QString()
(null). A URL like "http://:kde@kde.org" is understood as an
empty-but-present username, for which toString(RemovePassword) will
return "http://@kde.org", keeping the empty-but-present username.

Change-Id: I2d97a7656f3f1099e3cf400b199e68e4c480d924
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
src/corelib/io/qurl.cpp
tests/auto/corelib/io/qurl/tst_qurl.cpp