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

QDir::cleanPath behaviour differs in Qt5 vs Qt4 with regard to UNC paths.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.10.1
    • Core: I/O
    • None
    • Windows

      In Qt 4.8.7 (the version of Qt 4 we're transitioning from), QDir::cleanPath works as-expected when switching servers for UNC paths:

      QDir::cleanPath("//server1/../server2/path/to/file.txt") == "//server2/path/to/file.txt"

      Under Qt 5 (5.10.1 to be exact), this behaviour no longer works, QDir::cleanPath will no longer go below the server-name, resulting in the path being unchanged - unfortunately this unchanged path does not work with anything (e.g. QFileInfo(path).exists() returns false, where as under Qt4 it would return true).

      This makes handling multiple files difficult when they're spread across different network locations (our typical use case is converting absolute <-> relative paths, where one file may be on a different network share to the reference file).

        1. qtbug71720.zip
          1 kB
          Friedemann Kleint
        2. QTBUG-72120.zip
          0.6 kB
          Andy Vincent
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            thiago Thiago Macieira
            andyvincent Andy Vincent
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes