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

QFileSystemModel shows deleted files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 4.7.4, 4.8.6, 5.5.0
    • Widgets: Itemviews
    • None
    • Windows 7 and Qt, nothing else needed

    Description

      Hi,

      on Windows, the widgets/itemviews/dirview example fails to update the root directory of a drive if it is suddenly empty.

      Howe to reproduce:
      1. Use an USB thumb drive that is empty. Add two random files.
      2. Open the dirview example
      3. Delete the two files
      => dirview example does not updated, the two files are still shown.

      Upon inspecting this problem, the culprit seems to be qfileinfogatherer.cpp that contains code like this:
      -------------------
      if (!allFiles.isEmpty())
      emit newListOfFiles(path, allFiles);
      -------------------
      WTF? Is it really saying that it's impossible that the directory is empty?

      NOTE: qfilesystemmodel only removes the file entries from cache in the slot connected to the signal above.
      NOTE: qfilesystemmodel was programmed in the I-always-know-best style and thus cannot be instructed from outside to through away part-of/all-of its cache.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            mmsattler Hendrik Sattler
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes