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

QDir::EntryInfoList or EntryInfo have a sorting issue with .., . and files starting by $ on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P3: Somewhat important
    • Some future release
    • 4.5.1
    • Core: I/O
    • None

    Description

      For some reason all special files that start by $ in c:\windows are before . and .. when Qt sort QDir content.

      On linux . and .. are always first entries.

      Here is the code to reproduce :

      #include <QtCore>
      #include <QDebug>
      
      int main( int argc, char * argv[] )
      {
              QCoreApplication app( argc, argv );
              QDir dir("c:\\windows\\");
              dir.setFilter(QDir::AllDirs | QDir::Hidden | QDir::System);
              dir.setSorting(QDir::Name | QDir::DirsFirst | QDir::IgnoreCase);
              QFileInfoList entryInfoList = dir.entryInfoList(dir.filter(), dir.sorting());
              foreach(const QFileInfo& info, entryInfoList)
                      qWarning() << info.fileName();
              return 0;
      }
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            menard Alexis Menard (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes