summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2012-05-03 18:49:46 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-04 13:03:35 +0200
commit7c717e56f51e7e8b1ab756f4b2b9717dadb1d82c (patch)
tree6573bbadbf3961d203280a480aad58fdcc90df7c /src
parent5190beae8166e615d2f910109cf081505ebe6807 (diff)
Fix QUrl::toString(StripTrailingSlash) to not turn file:/// into file:
It should only strip one slash (as the name indicates), and not if the path is just "/". Change-Id: I133a81977241de77a49d1d1559143d30e0bd52f8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qurl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index aed1be2ffb..649b3a009c 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -2159,7 +2159,7 @@ QString QUrl::toString(FormattingOptions options) const
d->appendPath(url, options, QUrlPrivate::FullUrl);
// check if we need to remove trailing slashes
- while ((options & StripTrailingSlash) && url.endsWith(QLatin1Char('/')))
+ if ((options & StripTrailingSlash) && d->path != QLatin1String("/") && url.endsWith(QLatin1Char('/')))
url.chop(1);
}