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

Crash when deleting files or directory outside application while qfilesystemmodel is watching

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.1.1
    • None
    • Windows 7

    Description

      My application crashes when I delete, create or rename files or directories from outside of it (like in Windows Explorer) while qfilesystemmodel is watching.
      It only happens within the watched directory set with setRootPath().
      Error message:

      ASSERT: "!fileName.isEmpty()" in file dialogs\qfilesystemmodel.cpp, line 1830

      In release build the output in QTreeView is garbage.

      EDIT: My bad of course since it was a failed assertion. If someone get into trouble with QFileSystemModel and QSortFilterProxyModel while trying to do recursive filtering on the tree, here is what bugged me for a very long time:

      while(sourceModel()->canFetchMore(index))
      sourceModel()->fetchMore(index);

      I never called canFetchMore thinking that fetchMore would fetch all files/directory within a directory referred by the index. This is half true I guess it fetches the number of files but not all there names, so my proxy was asking with indexes which had empty data in the model, and finally the model caught this with an assertion. I not sure though.

      Anyway it works now and I spotted the problem was with fetchMore. Closed!

      Attachments

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

        Activity

          People

            w00t Robin Burchell
            wimoh-x Wimoh-X
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes