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

QFileSystemModel does not list device (block/char) files

    XMLWordPrintable

Details

    • 3b093034b638a69b4dc91212d1743638864a1337

    Description

      See the attached testcase: I get directories and symlinks, but no actual device files.

      The QDir::System filter is explicitely passed (whose description, btw, is "List system files (on Unix, FIFOs, sockets and device files are included; on Windows, .lnk files are included)").

      I think I tracked this issue down to http://qt.gitorious.org/qt/qt/blobs/master/src/gui/dialogs/qfilesystemmodel.cpp#line1819 . _q_fileSystemChanged is the method called by the gathering thread when new data is available. Line 1849 is the problem:

      if (info.size() == -1 && !info.isSymLink()) {
      

      size() is defined here and it returns -1 for all kind of special files: http://qt.gitorious.org/qt/qt/blobs/master/src/gui/dialogs/qfileinfogatherer_p.h#line127

      So: device files are not symlinks and report a size of -1, thus they are removed from the model.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-20968
          # Subject Branch Project Status CR V

          Activity

            People

              peppe Giuseppe D'Angelo
              peppe Giuseppe D'Angelo
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes