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

Regression:QFileInfo::path inconsistent behiviour

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 4.8.4
    • 4.8.3
    • Core: I/O
    • None
    • Windows

      QFileInfo::path() returns absolute path instead of relative path. which is inconsistent with older behavior on windows.
      Following code can be used to see the behavior. The first out put is inconsistent with other two it return absolute path where as other prints relative path.

      QFileInfo info1(QLatin1String("C:"));
      qDebug()<<info1.path();

      QFileInfo info2(QLatin1String("dir/file"));
      qDebug()<<info2.path();

      QFileInfo info3(QLatin1String("file"));
      qDebug()<<info3.path();

      Output :
      "C:\the\current\path"
      "dir"
      "."

      following change id introduced this in Qt 4.8.3
      Change-Id: I47a197c6af066f532442ad269be57597ec61303a

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

            andysh Andy Shaw
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes