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

Input to QUrl::fromLocalFile should be canonical

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Out of scope
    • P2: Important
    • Some future release
    • 4.4.0
    • Core: I/O
    • None

    Description

      The following fails:

      QUrl url = QUrl::fromLocalFile("c:/depot/testing/test/../dir with space/test.html");
      bool res = QDesktopServices::openUrl(url);
      QMessageBox::information(0, url.toString(),
      res ? "Success" : "Failure");

      while the following works:

      QUrl url = QUrl::fromLocalFile("c:/depot/testing/dir with space/test.html");
      bool res = QDesktopServices::openUrl(url);
      QMessageBox::information(0, url.toString(),
      res ? "Success" : "Failure");

      QUrl::fromLocalFile does not canonize the input, so the calling code should ensure that "." and ".." are resolved.

      Attachments

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

        Activity

          People

            stormols Marius Storm-Olsen
            vhilshei Volker Hilsheimer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes