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

In case of newly mounted volume, QDir/QFile queries unreliable from slot connected to QFileSystemWatcher::directoryChanged signal

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.9.4
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Qt 5.9.4 on ubuntu xenial.

    • Platform/s:
      Linux/X11

      Description

      Using QFileSystemWatcher to monitor linux FS "/media" directory in order to detect USB Flash drive insertions and removals. Have noticed that on drive insertion, QDir/QFile queries regarding the newly mounted volume contents are unreliable when made from a slot directly connected to the directoryChanged() signal, but will perform correctly a short while later (100mS delay seems to fix things for me).

      Is there some way that QFileSystemWatcher could be enhanced so that it's notifications were deferred until underlying cataloguing of the monitored directory tree was up-to-date, rather than everyone in userland having to debug and then work around this issue.

      Maybe even just a warning in the documentation?

       

        Attachments

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

          Activity

            People

            • Assignee:
              cnn Qt Core & Network
              Reporter:
              richardlang Richard Lang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes