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

Force QFileSystemWatcher to use its polling engine

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • Some future release
    • 4.6.0
    • Core: I/O, Network
    • None
    • $ uname -a
      Linux Ain 2.6.26 #1 SMP Wed Nov 26 06:10:27 CET 2008 i686 GNU/Linux

      $ qmake -version
      QMake version 2.01a
      Using Qt version 4.6.0 in /usr/lib

    Description

      On Linux, QFileSystemWatcher will use inotify if available. However, inotify doesn't support notifications for changes to files on network mounts (for instance, an NFS mounted directory).

      QFileSystemWatcher contains a polling engine, which would solve this problem. However, there is no public API to force QFileSystemWatcher to use its polling engine, nor does it auto-detect whether a file is on an NFS share or not.

      The ideal solution would be for Qt to detect whether a file is "supported" by inotify and fall back on its polling engine only for non-supported file locations. I don't know whether that's possible however. Another solution would be to provide a public API to force the use of the poller engine.

      Note: you can force QFileSystemWatcher to use the poller engine using watcher.setObjectName(QLatin1String("_qt_autotest_force_engine_poller"));, but this is not in the public API so it may break with future releases (works with 4.6.0).

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            tiemen T Schut
            Votes:
            7 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes