diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-04-23 17:06:08 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-24 19:36:55 +0200 |
commit | 77a816c00d80780f81dfcd723c0a287f2ddf660e (patch) | |
tree | 728633d2681d3304cae5e74a1a1daac8071aa7a7 /src/corelib | |
parent | 092118855ba47a0061e5b54198c49c3ad05b5aed (diff) |
Ensure that QUrl::toLocalFile returns decoded paths
QUrl::path() already decodes almost everything, but let's pass the
formatting flag to be sure.
Note: decoding of control characters from U+0001 to U+001F is not
implemented. Non-UTF8 sequences are also not representable.
Change-Id: I9a0ae2282ec3d48cc0e70e5b2d3824fb120709ed
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qurl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index ca74544e55..5cc49c8192 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -2502,11 +2502,11 @@ QString QUrl::toLocalFile() const return QString(); QString tmp; - QString ourPath = path(); + QString ourPath = path(QUrl::MostDecoded); // magic for shared drive on windows if (!d->host.isEmpty()) { - tmp = QStringLiteral("//") + d->host + (ourPath.length() > 0 && ourPath.at(0) != QLatin1Char('/') + tmp = QStringLiteral("//") + host() + (ourPath.length() > 0 && ourPath.at(0) != QLatin1Char('/') ? QLatin1Char('/') + ourPath : ourPath); } else { tmp = ourPath; |