Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.15.0
-
None
-
-
eb546469849d2bf560f41b14366832e1f8b22456 (qt/tqtc-qtbase/dev) 6dd1ecb46d6e45b7a123ef519545ee94066be221 (qt/qtbase/5.15)
Description
People use url.toDisplayString(QUrl::PreferLocalFile) in messages shown to the user, assuming that this will do the right thing: show a display string for remote URL, and show toLocalFile() for local files. It's almost the case, except for local paths that contain %20.
Then it shows %2520 instead of %20.
Reference https://bugs.kde.org/show_bug.cgi?id=418984
Unittest contribution: tst_qurl.cpp.diff
For the record, the reasoning in QTBUG-41729 was "You know I consider any situation in which you lost the distinction between URL and local file to be a design flaw. So, with the understanding that any place where you use PreferLocalFile you've already lost, I don't see the harm in making it worse." – This applies to this fix as well
Attachments
For Gerrit Dashboard: QTBUG-84594 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
304275,7 | Fix QUrl::toDisplayString(PreferLocalFile) returning an encoded path | dev | qt/qtbase | Status: MERGED | +2 | 0 |
306324,2 | Fix QUrl::toDisplayString(PreferLocalFile) returning an encoded path | 5.15 | qt/qtbase | Status: MERGED | +2 | 0 |