Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-84594

QUrl::toDisplayString(PreferLocalFile) doesn't imply nor support FullyDecoded

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.15.1, 6.0
    • 5.15.0
    • Core: URL Handling
    • None
    • Linux/X11
    • 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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dfaure_kdab David Faure
            dfaure_kdab David Faure
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes