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

QDirIterator and filter QDir::NoDotAndDotDot

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 4.5.3
    • Core: I/O
    • None

    Description

      When using a QDirIterator with QDir::NoDotAndDotDot as filter, i'm getting no content of a directory.

      ----------------------
      Setup:
      ----------------------

      calling ls on the testdirectory:

      testdir2$ ls -l
      insgesamt 16
      rw-rr- 1 para para 1 2009-11-22 01:40 f1
      rw-rr- 1 para para 1 2009-11-22 01:40 f2
      drwxr-xr-x 3 para para 4096 2009-11-22 01:42 testdir3
      drwxr-xr-x 2 para para 4096 2009-11-22 01:42 testdir4

      iterate over files / directorys with QDirIterator and without filter:

      QDirIterator it("testdir2");
      while(it.hasNext())
      {
      std::cout << it.next().asStdString() << std::endl;
      }

      gives:
      /home/para/testdir2/f1
      /home/para/testdir2/f2
      /home/para/testdir2/testdir3
      /home/para/testdir2/.
      /home/para/testdir2/..
      /home/para/testdir2/testdir4

      and with the following QDirIterator
      QDirIterator it("testdir2", QDir::NoDotAndDotDot);

      there simply is no output

      expected result:
      /home/para/testdir2/f1
      /home/para/testdir2/f2
      /home/para/testdir2/testdir3
      /home/para/testdir2/testdir4

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            mkeir Mark Keir
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes