Fix QUrl::topLevelDomain(QUrl::FullyDecoded)

qt_ACE_do(".co.uk") was returning an empty string because of the
leading dot. This has always caused issues in KDE code too, where ACE
normalization needs the dot removed, and re-added afterwards.

Change-Id: Id9fcea0333cf55c14d755a86d4bf33a50f194429
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
bb10
David Faure 2013-07-01 15:12:36 +02:00 committed by The Qt Project
parent 539f90e971
commit 170469ef84
2 changed files with 4 additions and 2 deletions

View File

@ -2479,7 +2479,8 @@ QString qt_ACE_do(const QString &domain, AceOperation op)
if (labelLength == 0) {
if (idx == domain.length())
break;
return QString(); // two delimiters in a row -- empty label not allowed
if (idx > 0)
return QString(); // two delimiters in a row -- empty label not allowed
}
// RFC 3490 says, about the ToASCII operation:

View File

@ -2863,7 +2863,8 @@ void tst_QUrl::effectiveTLDs()
{
QFETCH(QUrl, domain);
QFETCH(QString, TLD);
QCOMPARE(domain.topLevelDomain(), TLD);
QCOMPARE(domain.topLevelDomain(QUrl::PrettyDecoded), TLD);
QCOMPARE(domain.topLevelDomain(QUrl::FullyDecoded), TLD);
}
void tst_QUrl::lowercasesScheme()