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

QFileSystemModel does not list device (block/char) files

XMLWordPrintable

    • 3b093034b638a69b4dc91212d1743638864a1337

      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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes